<small id='J5cgw'></small><noframes id='J5cgw'>

        • <bdo id='J5cgw'></bdo><ul id='J5cgw'></ul>

        <legend id='J5cgw'><style id='J5cgw'><dir id='J5cgw'><q id='J5cgw'></q></dir></style></legend>

        <i id='J5cgw'><tr id='J5cgw'><dt id='J5cgw'><q id='J5cgw'><span id='J5cgw'><b id='J5cgw'><form id='J5cgw'><ins id='J5cgw'></ins><ul id='J5cgw'></ul><sub id='J5cgw'></sub></form><legend id='J5cgw'></legend><bdo id='J5cgw'><pre id='J5cgw'><center id='J5cgw'></center></pre></bdo></b><th id='J5cgw'></th></span></q></dt></tr></i><div id='J5cgw'><tfoot id='J5cgw'></tfoot><dl id='J5cgw'><fieldset id='J5cgw'></fieldset></dl></div>
        <tfoot id='J5cgw'></tfoot>

        Yii 2:AngularJS 的目录结构?

        Yii 2: directory structure with AngularJS?(Yii 2:AngularJS 的目录结构?)

            <tbody id='3qvr2'></tbody>
          • <tfoot id='3qvr2'></tfoot>

            <small id='3qvr2'></small><noframes id='3qvr2'>

            • <bdo id='3qvr2'></bdo><ul id='3qvr2'></ul>

                  <i id='3qvr2'><tr id='3qvr2'><dt id='3qvr2'><q id='3qvr2'><span id='3qvr2'><b id='3qvr2'><form id='3qvr2'><ins id='3qvr2'></ins><ul id='3qvr2'></ul><sub id='3qvr2'></sub></form><legend id='3qvr2'></legend><bdo id='3qvr2'><pre id='3qvr2'><center id='3qvr2'></center></pre></bdo></b><th id='3qvr2'></th></span></q></dt></tr></i><div id='3qvr2'><tfoot id='3qvr2'></tfoot><dl id='3qvr2'><fieldset id='3qvr2'></fieldset></dl></div>
                  <legend id='3qvr2'><style id='3qvr2'><dir id='3qvr2'><q id='3qvr2'></q></dir></style></legend>
                1. 本文介绍了Yii 2:AngularJS 的目录结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的 Yii 2 应用程序的目录结构应该是什么?使用 Yii 2 视图真的有意义吗,还是我必须创建一个 AngularJS 应用程序目录并将 Yii 应用程序放在它的一个文件夹中?

                  What should the directory structure of my Yii 2 application be? Does it really makes sense to use Yii 2 views or do I have to create an AngularJS application directory and put the Yii application in one of its folders?

                  解释是什么?

                  推荐答案

                  我建议您将后端 (Yii 2) 和前端 (AngularJS) 分成两个单独的文件夹.死苍蝇和肉丸应分开食用.Yii 2 只提供服务器 API,而 AngularJS 做所有其他事情.

                  I recommend you to split your backend (Yii 2) and frontend (AngularJS) in two separate folders. Dead flies and meatballs should be served separately. Yii 2 just provides the server API, while AngularJS does all other things.

                  project/
                    backend/        // Yii2 app
                      web/          // Public visible backend folder
                        index.php   // Entry point
                      config/
                      controllers/
                      models/
                      ...
                    frontend/
                      app/          // Your AngularJS application here
                        css/        // Styles (.less or .css)
                        img/        // Images
                        lib/        // Third-party libraries such as jQuery or AngularJS
                        js/         // .js files (controllers, services, etc.)
                        partials/   // Templates (.html)
                        index.html
                      tests/        // AngularJS tests
                      node_modules/
                      ...
                  

                  Web 服务器应该这样配置:

                  The web server should be configured this way:

                  • http://mycoolsite.com/api/* 请求 project/backend/web/;
                  • http://mycoolsite.com/* 请求 project/frontend/app/.
                  • http://mycoolsite.com/api/* requests to project/backend/web/;
                  • http://mycoolsite.com/* requests to project/frontend/app/.

                  如果您使用 Apache 作为网络服务器,mod_alias 可以提供帮助你.

                  If you use Apache as a web server, mod_alias can help you.

                  请注意,backendfrontend 目录中的文件夹结构可能会有所不同.

                  Note, that the folder structure inside the backend or frontend directory may vary.

                  • 对于后端,这取决于您喜欢哪种模板(基本或高级).在我的示例中,我使用了基本的.
                  • 对于 frontend,这取决于您的 AngularJS 应用程序组织.在示例中,我使用了 AngularJS 教程应用程序,但对于大型应用程序,最好使用 模块化结构.
                  • For backend it depends on which template you prefer (basic or advanced). In my example I used the basic one.
                  • For frontend it depends on your AngularJS application organization. In the example I used the AngularJS Tutorial App, but for huge applications it is better to use a modular structure.

                  这篇关于Yii 2:AngularJS 的目录结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Joomla 2.5 much faster than Joomla 1.5 Querywise(Joomla 2.5 比 Joomla 1.5 Querywise 快得多吗)
                  How to share Joomla login session from one joomla website to one ASP.Net MVC website(如何将 Joomla 登录会话从一个 joomla 网站共享到一个 ASP.Net MVC 网站)
                  htaccess redirect root to subdirectory but allow index.php in root AND query strings to function(htaccess 将根重定向到子目录,但允许根和查询字符串中的 index.php 起作用)
                  Joomla include database functions(Joomla 包含数据库功能)
                  nl2br() not working when displaying SQL results(显示 SQL 结果时 nl2br() 不起作用)
                  Joomla 2.5 JFactory::getSession(); seems to be caching in firefox(Joomla 2.5 JFactory::getSession();似乎在 Firefox 中缓存)

                    <small id='4EYlR'></small><noframes id='4EYlR'>

                        <legend id='4EYlR'><style id='4EYlR'><dir id='4EYlR'><q id='4EYlR'></q></dir></style></legend><tfoot id='4EYlR'></tfoot>

                        • <i id='4EYlR'><tr id='4EYlR'><dt id='4EYlR'><q id='4EYlR'><span id='4EYlR'><b id='4EYlR'><form id='4EYlR'><ins id='4EYlR'></ins><ul id='4EYlR'></ul><sub id='4EYlR'></sub></form><legend id='4EYlR'></legend><bdo id='4EYlR'><pre id='4EYlR'><center id='4EYlR'></center></pre></bdo></b><th id='4EYlR'></th></span></q></dt></tr></i><div id='4EYlR'><tfoot id='4EYlR'></tfoot><dl id='4EYlR'><fieldset id='4EYlR'></fieldset></dl></div>
                            <tbody id='4EYlR'></tbody>
                            <bdo id='4EYlR'></bdo><ul id='4EYlR'></ul>