目前我的后端和前端都有2个Yii安装设置。 但是在努力解决这个问题时,它会让人感到困惑,我想知道这是否以正确的方式完成。 下面是我的文件夹结构设置的示例。
- backend - assets - css - images - js - protected - components - config main.php - controllers - data - extensions - models - modules - runtime - views - layouts - site .htaccess yiic yiic.php - themes - upload index.php .htaccess frontend - assets - css - images - protected - commands - components - config main.php - controllers - data - extensions - models - modules - runtime - views - layouts - site .htaccess yiic yiic.php - themes index.php .htaccess无论如何可以告诉我这是一个好方法。 或者这是一种愚蠢的方式。 这样做的正常方法是什么。 我查看了文档,但它都是不完整的或不具体的。 我想要的是为Yii设置后端和前端结构的最常用方法。
Currently I have 2 install setups of Yii for both my backend and frontend. But while working on this it gets abit confusing and I was wondering if this done in the right way. Below is an example how my folder structure is setup.
- backend - assets - css - images - js - protected - components - config main.php - controllers - data - extensions - models - modules - runtime - views - layouts - site .htaccess yiic yiic.php - themes - upload index.php .htaccess frontend - assets - css - images - protected - commands - components - config main.php - controllers - data - extensions - models - modules - runtime - views - layouts - site .htaccess yiic yiic.php - themes index.php .htaccessCan anyway tell me of this is a good way. Or is it a stupid way. What is the normal way to do this. I have looked into documentation but it's all uncomplete or not specific. What I want is the most common way to setup a backend and frontend structure for Yii.
最满意答案
我的意见,最好的方法是不破坏封装并使用如下设置:
http://www.yiiframework.com/wiki/63/organize-directories-for-applications-with-front-end-and-back-end-using-webapplicationend-behavior/ http://habrahabr.ru/post/117457/ (俄语)在这种情况下:
您将能够将所有控制器和视图存储在一个位置 在模块结构(当你将使用它)时,它不会破坏它们的封装,你将能够轻松地在你的网站之间共享它们My opinion, the best way is do not break encapsulation and use setup like the following:
http://www.yiiframework.com/wiki/63/organize-directories-for-applications-with-front-end-and-back-end-using-webapplicationend-behavior/ http://habrahabr.ru/post/117457/ (russian)In this case:
you will be able to store all controllers and views in one place on module structure(when you will use it) that will not break their encapsulation and you will be able easy to share their between your sites更多推荐
发布评论