Home > Backend Development > PHP Tutorial > yii 关于结构的有关问题

yii 关于结构的有关问题

WBOY
Release: 2016-06-13 12:06:46
Original
974 people have browsed it

yii 关于结构的问题
新手,看教程以后 发现 无论CActiveRecord派生出来的数据库类,还是CFormModel派生出的表单验证类 都要放到models里。

我想分开放到不同目录,或者想例如说在3层架构上加一层。有什么配置文件可以改么。

解决方法
1:把models里再建一级目录
2:建立models平级目录。

有什么可以指点的配置么。谢谢
------解决思路----------------------
修改配置文件中的import部分
如下

<br />	'import'=>array(<br />		'application.models.*',<br />		'application.models.common.ar.*',<br />		'application.models.common.logicModel.*',<br />		'application.models.admin.*',<br />		'application.models.api.*',<br />		'application.components.*',<br />		'application.components.common.*',<br />		'application.components.common.file.*',<br />		'application.components.admin.*',<br />		'application.components.api.*',<br />		'application.utils.*',<br />		'application.utils.FirePHPCore.*',<br />		'application.widgets.admin.*',<br />		'application.widgets.common.*',<br />		'application.widgets.*',<br />	),<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template