yii使用gii创建后台模块与widget使用
1.在protected/config/main.php中打开gii的配置属性。
'gii'=>array(
'class'=>'system.gii.GiiModule','password'=>'输入你的密码',//If removed,Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),),2.通过浏览器访问xxx.com/index.php?r=gii
3.gii自动生成
Controller Generator 生成控制器
Crud Generator 数据库操作
Form Generator 生成表单
Model Generator 生成模型
Module Generator 生成模块
4.添加模块ID
在config/main.php的modules中添加模块ID。
'modules' => array(
'gii' => array(...),'模块ID',
),5.如何访问模块
http://www.xxx.com/index.php?r=模块/控制器/方法
6.小物件widget的使用
<?php $form=$this->beginWidget('CActiveForm'); ?>
<?php echo $form->textField(模型,'表单名',html属性); ?>
<?php $this->endWidget(); ?>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。