|
First, you need the framework, so go to http://framework.zend.com/download. There are many formats in which you can download. I am expecting your zend application in a sub-directory of your domain or localhost. Construct the directory and file structure on your sub-directory. And paste library directory. You can find this directory under the unzipped file of zend framework. There are only those files to be created, mentioned on the RHS of the image, while directories on the LHS. I have all my application and other stuffs in "zend" directory. In your later stage of development, you can make your directory structure as simple as you want to be, but for initial stage, let it be like this.
Here are the contents of the files: 1. .htaccess RewriteEngine on RewriteBase /zend/ RewriteRule !\.(js|css|ico|gif|jpg|png)$ index.php
2. Index.php or called bootstrap file set_include_path('.' . PATH_SEPARATOR . './application/library/' .PATH_SEPARATOR . './application/models/'); date_default_timezone_set('Europe/Amsterdam'); require_once 'Zend/Controller/Front.php'; $controller = Zend_Controller_Front::getInstance(); $controller->setControllerDirectory('./application/controllers/')->setBaseUrl('/zend')->throwExceptions(true); $response = $controller->dispatch();
3. IndexController.php require_once 'Zend/Controller/Action.php'; class IndexController extends Zend_Controller_Action { public function indexAction() { echo 'Geeks this is running!'; } } 4. index.phtml No content Now run something like this: http://domain.com/zend.
|