nirbhab.com

Recent Article

2008-07-04

First, you need the framework, so go to http://fra..

more

2008-06-30

  Design patterns As a developer, I have star..

more

Running my first hello world on Zend Framework

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.

 

Running my first hello world on 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.

 

Comment

Donations For Us

Pic 2

  • Codeigniter
    CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you're a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you're tired of ponderously large and thoroughly undocumented frameworks.
  • JQuery
    JQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.
  • Joomla
    Joomla! is an award-winning Content Management System (CMS) that will help you build websites and other powerful online applications. Best of all, Joomla! is an open source solution that is freely available to everybody.
  • Ajax
    Ajax (asynchronous JavaScript and XML), or AJAX, is a group of inter-related web development techniques used for creating interactive web applications. A primary characteristic is the increased responsiveness of web pages achieved by exchanging small amounts of data with the server "behind the scenes" so that entire web pages do not have to be reloaded each time there is a need to fetch data from the server. This is intended to increase the web page's interactivity, speed, functionality and usability.
  • PHP
    PHP (a recursive acronym for PHP: Hypertext Preprocessor) is a computer scripting language, originally designed for producing dynamic web pages. It is for server-side scripting, but can be used from a command line interface or in standalone graphical applications.
  • JSON
    JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

API Gallery