Zend Framework – Hello World

Quick Start Zend Framework Hello World Program

Install Zend Framwork1.11 on you localhost

Create your file system

application/
controllers/
IndexController.php
models/
views/
scripts/
index/
index.phtml
helpers/
filters/
html/
.htaccess
index.php

Rewrite .htaccess file

    RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ – [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Open the file application/controllers/IndexController.php, and enter the following:

/** Zend_Controller_Action */
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
}
}

application/views/scripts/index/index.phtml. Create this file, and type in some HTML:

<!DOCTYPE html
PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>My first Zend Framework App</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>

Visit your site
http://example.com/
http://example.com/index
http://example.com/index/index

//