
~ $ svn co http: // framework.zend.com / svn / framework / standard / trunk / bin / . / bin
~ $ svn co http: // framework.zend.com / svn / framework / standard / trunk / library / Zend. / library / Zend
Note : if you are true-linux-comed and often create projects on ZF, then drop the zf.sh file into / usr / bin (or any other way where the system can find it), and the Zend folder is where you have the included_path for PHP (run the command php -i | grep include_path)
htdocs
| - bin
| | - zf.bat
| | - zf.php
| `- zf.sh
`- library
`- Zend
# don't forget chmod a + x ./bin/zf.sh
~ $. / bin / zf.sh create project. /
Note : the utility was tested under Linux, it is likely that it will work under Windows too (use zf.bat)
htdocs
| - application
| | - Bootstrap.php
| | - configs
| | `- application.ini
| | - controllers
| | | - ErrorController.php
| | `- IndexController.php
| | - models
| `- views
| | - helpers
| `- scripts
| | - error
| | `- error.phtml
| `- index
| `- index.phtml
| - library
| - public
| `- index.php
`- tests
| - application
| `- bootstrap.php
| - library
| `- bootstrap.php
`- phpunit.xml
# create a users controller and two actions
~ $. / bin / zf.sh create controller users
~ $. / bin / zf.sh create action login users
~ $. / bin / zf.sh create action logout users
<? php
class UsersController extends Zend_Controller_Action
{
public function init ( )
{
/ * Initialize action controller here * /
}
public function indexAction ( )
{
// action body
}
public function loginAction ( )
{
// action body
}
public function logoutAction ( )
{
// action body
}
}
< center > View script for controller < b > users < / b > and script / action name < b > login < / b > < / center >
Note : If the public folder is not the root folder, then add the “RewriteBase / public /” rule to the “/ public /.htaccess” file after “RewriteEngine On”
Source: https://habr.com/ru/post/58911/
All Articles