Zend Framework Hello World
Folder Skeleton
hello_world
application
controllers
indexController.php
modules
views
scripts
index
index.phtml
library
public
index.php
index.php
ini_set('include_path', ini_get('include_path') . ':../library');
/* Zend Loader */
require "Zend/Loader.php";
/* Required Classes */
Zend_Loader::loadClass('Zend_Controller_Front');
/* Setup Controller */
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('../application/controllers');
$front->throwExceptions(true);
/* GO! */
$front->dispatch();
indexController.php
class IndexController extends Zend_Controller_Action {
function indexAction() {
$this->view->world = 'World!';
}
}
index.phtml
Hello <?=$this->world?>