Yii的后端和前端设置(backend and frontend setup for Yii)

编程入门 行业动态 更新时间:2024-10-22 08:40:19
Yii的后端和前端设置(backend and frontend setup for Yii)

目前我的后端和前端都有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 .htaccess

Can 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

更多推荐

本文发布于:2023-08-05 07:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428855.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后端   Yii   backend   setup   frontend

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!