快速创建Zend应用
root@coder-671T-M:/mydev_src/zend_framework_learn/ZendFramework-1.11.11# tree -L 2.├── bin│
├── zf.bat│ ├── zf.php│ └── zf.sh├── demos│ └── Zend├── documentation│ ├── api│
└── manual├── externals│ └── dojo├── extras│ ├── library│ └── tests├── incubator├── INSTALL.txt├── library│
└── Zend├── LICENSE.txt├── README.txt├── resources│ └── languages├── src└── tests ├── AllTests.php ├── phpunit.xml
├── resources ├── runtests.sh ├── TestConfiguration.php.dist ├── TestHelper.php └── Zend20 directories, 11 files
具体给出的命令格式如下:
Zend Framework Command Line Console Tool v1.11.11Usage: zf [--global-opts] action-name [--action-opts] provider-name [--provider-opts] [provider parameters ...]
Note: You may use "?" in any place of the above usage string to ask for more specific help information. Example: "zf ? version" will list all available actions for the version provider.Providers and their actions: Version zf show version mode[=mini] name-included[=1]
Note: There are specialties, use zf show version.? to get specific help on them. Config zf create config zf show config zf enable config Note: There are specialties, use zf enable config.? to get specific help on them. zf disable config Note: There are specialties, use zf disable config.? to get specific help on them. Phpinfo zf show phpinfo Manifest zf show manifest Profile zf show profile Project zf create project path name-of-profile file-of-profile zf show project
Note: There are specialties, use zf show project.? to get specific help on them. Application zf change application.class-name-prefix class-name-prefix Model zf create model name module View zf create view controller-name action-name-or-simple-name module Controller zf create controller name index-action-included[=1] module Action zf create action name controller-name[=Index] view-included[=1] module Module zf create module name Form zf enable form module zf create form name module Layout zf enable layout zf disable layout DbAdapter zf configure db-adapter dsn section-name[=production] DbTable zf create db-table name actual-table-name module force-overwrite
Note: There are specialties, use zf create db-table.? to get specific help on them. ProjectProvider zf create project-provider name actions
为了运行方便可以把如下目录加入到path
/mydev_src/zend_framework_learn/ZendFramework-1.11.11/bin
设置临时的path,重启会失效的。
export PATH=$PATH:/mydev_src/zend_framework_learn/ZendFramework-1.11.11/bin
显示框架版本
root@coder-671T-M:~# zf.sh show version
Zend Framework Version: 1.11.11
Project 创建一个项目
zf create project path name-of-profile file-of-profile
zf show project
Note: There are specialties, use zf show project.? to get specific help on them.
Config创建include_path配置文件
zf create config
zf show config
zf enable config
Note: There are specialties, use zf enable config.? to get specific help on them.
zf disable config
Note: There are specialties, use zf disable config.? to get specific help on them.
root@coder-671T-M:/mydev_src/zend_framework_learn/www/zf_demo2# zf.sh create config
Successfully written Zend Tool config.
It is located at: /root/.zf.iniAction为指定controller创建action,默认是的controller是Index
zf create action name controller-name[=Index] view-included[=1] module
root@coder-671T-M:/mydev_src/zend_framework_learn/www/zf_demo2# zf.sh create action add NewsManage 1 testmod
Note: PHPUnit is required in order to generate controller test stubs.
Creating an action named add inside controller at /mydev_src/zend_framework_learn/www/zf_demo2/application/modules/testmod/controllers/NewsManageController.php
Updating project profile '/mydev_src/zend_framework_learn/www/zf_demo2/.zfproject.xml'
Creating a view script for the add action method at /mydev_src/zend_framework_learn/www/zf_demo2/application/modules/testmod/views/scripts/news-manage/add.phtml
Updating project profile '/mydev_src/zend_framework_learn/www/zf_demo2/.zfproject.xml'