cakephp烤
2021-02-19 01:20
标签:文件路径 内容 sof 连接 www not mysql 一点 编写 蛋糕php官网:http://cakephp.org/ 使用烘焙生成代码。 1:首先你要把数据库建好,例如我们使用PowerDesigner把数据库设计好,生成sql语句,在mysql中创建数据库tfss,创建两个简单的表(特别需要注意表名以及外键的命名,请参考cakephp的命名规范): http://www.hamegasoft.com/attached/file/20200522/20200522070020_0371.html cakephp烤 标签:文件路径 内容 sof 连接 www not mysql 一点 编写 原文地址:https://www.cnblogs.com/99876w/p/12936134.html
如果存在管理组,则删除表;否则删除表。
/ * ================================================ ============= * /
/ *表:admingroups * /
/ * ========================= ================================== * //
创建表admingroups
(
id int not null auto_increment comment‘管理组ID‘,
ac_user int不能为空默认值1注释‘允许创建用户(0:false; 1:trure)‘,
ac_class int不能为空默认值1 comment‘允许创建班级组别(0:false; 1:trure)‘ ,
主键(id)
);
alter table admingroups评论‘管理组表‘;
删除表(如果存在用户组);
/ * ================================================ ============= * /
/ *表:用户组* /
/ * ========================= ================================== * //
创建表用户组
(
id int不为null auto_increment注释‘用户组ID‘,
admingroup_id int不为null默认值0 comment‘用户组类型1:学生; 2:校长; 3:老师)‘,
group_name varchar(50)不为null默认值‘‘comment‘用户组名称(管理组为学生的:中1?中6总6个等级),
user_count int不为null缺省值0评论‘用户数量‘,
alter table usergroups评论“用户组表”;
2:首先将php的php.exe加入环境变量中,例如我的php安装在E:workServerPHPCore下,然后将路径加入到路径中
3:在命令行里面执行如下命令:php cakephp的bake文件路径bake
例如你的cakephp解压文件全部放在
“ E:/ work / PHPPro / CakePHPTest /”目录下
那么则在命令行执行:php E:/work/PHPPro/CakePHPTest/lib/Cake/Console/cake.php bake
1 )首先要知道相关命令:
[D]数据库配置
[M] odel
[V] iew
[C] ontroller
[P]项目
[F] ixture
[T]最佳情况
[Q] uit
2):执行了以上命令,开始配置数据库
欢迎使用CakePHP v2.1.0控制台
----------------------------------------- ----------------------
应用程式:应用程式
路径:E:workPHPProCakePHPTestapp
--------------------------------------------- ------------------
找不到您的数据库配置。花一点时间来创建一个。
-------------------------------------------------- -------------
----------------------------------------------------- --------------------------
数据库配置:
--------------------- ------------------------------------------
名称:
[默认]>默认
数据源:(Mysql / Postgres / Sqlite / Sqlserver)
[Mysql]> mysql
持久连接?(y / n)
[n]> n
数据库主机:
[localhost]> localhost
端口?
[n]> 3306
用户:
[root]> root
密码:
> 000000
数据库名称:
[cake]> tfss
表前缀?
[n]> n
表编码?
[n]> n
--------------------------------------------- ------------------
将创建以下数据库配置:
------------------------ ---------------------------------------
名称:默认
驱动程序:mysql
持久性:false
主机:本地主机
端口:3306
用户:根 密码
:****
数据库:tfss
-------------------------------------------------- -------------
看起来还好吗?(y / n)
[y]> y
是否要添加其他数据库配置?
[n]> n
创建文件E:workPHPProCakePHPTestappConfigdatabase.php
编写‘E:workPHPProCakePHPTestappConfigdatabase.php‘3
)使用烘烤所有生成的m,v,c
我们在命令行敲入:php E:/ work / PHPPro / CakePHPTest / lib / Cake / Console / cake.php bake all
执行如下:
欢迎使用CakePHP v2.1.0控制台
------------------------------- --------------------------------
App:app
路径:E:workPHPProCakePHPTestapp
---------- -------------------------------------------------- -
全部烤
-------------------------------------------------- -------------
基于当前数据库的可能模型:
1.管理员组
2.
用户组从上面的列表中输入一个数字,
键入另一个模型的名称,或使用‘q‘退出
[ q]> 1个
Admingroup的烘焙模型类...
创建文件E:workPHPProCakePHPTestappModelAdmingroup.php
编写了E:workPHPProCakePHPTestAppModelAdmingroup.php
未安装PHPUnit。您是否仍要烘焙单元测试文件?(y / n)
[y]> n
Admingroups的烘焙控制器类...
创建文件E:workPHPProCakePHPTestappControllerAdmingroupsController.php
编写了E:workPHPProCakePHPTestappControllerAdmingroupsController.php
未安装PHPUnit。您是否仍要烘焙单元测试文件?(y / n)
[y]> n
烘烤`index`视图文件...
创建文件E:workPHPProCakePHPTestappViewAdmingroupsindex.ctp
写了`E:workPHPProCakePHPTestappViewAdmingroupsindex.ctp``
烘烤`view`视图文件...
创建文件E:workPHPProCakePHPTestappViewAdmingroupsview.ctp
编写`E:workPHPProCakePHPTestappViewAdmingroupsview.ctp`
烘烤视图文件...
创建文件E:workPHPProCakePHPTestappViewAdmingroupsadd.ctp
编写`E:workPHPProCakePHPTestappViewAdmingroupsadd.ctp
烘焙视图文件...
创建文件E:workPHPProCakePHPTestappViewAdmingroupsedit.ctp写成
E:workPHPProCakePHPTestappViewAdmingroupsedit.ctp`
烘焙全部完成
4)关于.ctp模板文件是否
使用Zend studio是无法打开.ctp文件的,那么我就增加了后缀名吧
窗口->首选项->常规->内容类型-> PHP内容类型添加* .ctp后缀
添加文件关联
窗口->首选项->常规->编辑器->文件关联添加关联
http://www.hamegasoft.com/attached/file/20200522/20200522070006_1152.html
http://www.hamegasoft.com/attached/file/20200522/20200522065629_5840.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522070078427842.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522070070177017.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065511211121.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065539323932.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522070066616661.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065662696269.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065782278227.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065842824282.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065695909590.html
http://www.hbvalve.com.cn/editor/attached/file/20200522/20200522065883348334.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065550195019.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065637913791.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065658655865.html
http://www.hebms.com/UploadFiles/file/20200522/20200522070034203420.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065891919191.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065511281128.html
http://www.hebms.com/UploadFiles/file/20200522/20200522070024102410.html
http://www.hebms.com/UploadFiles/file/20200522/20200522070027082708.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065741084108.html
http://www.hebms.com/UploadFiles/file/20200522/20200522065828122812.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522065709_7822.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522065523_0946.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522065632_3446.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522065746_2822.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522070005_3291.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522065556_6728.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522070012_3135.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522070018_7979.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522070044_1573.html
http://www.hi940.com.tw/UpLoadFiles/kindeditor/file/20200522/20200522065821_8291.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065814_3103.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065847_7478.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522070035_6853.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065738_7791.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522070023_2947.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065546_1072.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065624_7010.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522070015_9822.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065524_3885.html
http://www.hiad.net.cn/kindeditor/attached/file/20200522/20200522065659_2791.html
下一篇:主题:免费的论文查重网站