Yii2 Lesson
来源:互联网 发布:数据库except 编辑:程序博客网 时间:2024/06/03 19:07
建立Gii的 CRUD
先查看是否开发环境,增加自己的IP地址
$config['bootstrap'][] = 'gii'; $config['modules']['gii'] = [ 'class' => 'yii\gii\Module', // uncomment the following to add your IP if you are not connecting from localhost. //'allowedIPs' => ['127.0.0.1', '::1','110.82.170.196'], ];
其次数据库建立个新表
/*show CREATE table posts */CREATE TABLE `posts` ( `post_id` int(11) NOT NULL AUTO_INCREMENT, `post_title` varchar(100) NOT NULL, `post_description` text NOT NULL, `author_id` int(11) NOT NULL, PRIMARY KEY (`post_id`), KEY `author_id` (`author_id`), CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
然后在 ?r=gii中建立models/post.php 和 CURD
解决Warning: scandir() has been disabled for security reasons in…的问题删除 vim /usr/local/php/etc/php.ini 里面的函数 scandir()重启系统(写多点 用得到的是php-fpm)/usr/local/nginx/sbin/nginx -s reloadservice php-fpm restartservice network restart
阅读全文
0 0
- Yii2 Lesson
- YII2
- YII2
- Yii2
- yii2
- Yii2
- lesson 2
- 《XML Lesson》
- Lesson 1
- Lesson 2
- Lesson 1
- Lesson 2
- Lesson 3
- Lesson 4
- Lesson 5
- Lesson 6
- Lesson 7
- Lesson 8
- 0 欢迎使用CSDN-markdown编辑器(博客自带)
- java编译器特性
- 算法:求最大公约数与最小公倍数
- java-ApiDemo
- office 2010/2013激活工具及VS2013密钥
- Yii2 Lesson
- 转载-好用的linux软件合集
- android studio- java注释自己动手弄起来
- 刷题3
- JAVA中多态的“缺陷”
- java-ApiValueDemo
- java-SimpleDateFormatDemo & BirthDemo
- java-TransDemo
- 序列化对象为xml文件,将xml文件反序列化为对象