Posted by: james | June 9, 2009

Some important notes regarding zend framewrok

Before staritng with creating new zend simple application please read componenet which are listed below from zend manual.

zend_controller

zend_view

zend_db

zend_layout

zend_app

Zend_Controller

Basic Task of zend_controller_front in sequence. Request –> Router –> Dispatch –> Respone.

Request –> Send Request object Router –> It check and make sense with controller and action, that means it say that which controller will be use and which action of that contoller will be use.

Dispatch –> It dsipatch to the specific action to specific controller and if no controller or action found then it will take default action or default contoller.

Response –> Send response object.

URI –> The part which comes after BASEURL. ex. http://www.mydomain.com/projects/modules/controller/action/param1/val1/param2/val2

URI == modules/controller/action/param1/val1/param2/val2

Zend_Controller_Action::__construct() performs some important tasks, such as registering the request and response objects, as well as any custom invocation arguments passed in from the front controller.

To redirect to new page there are two methods.

1._forward($action, $controller = null, $module = null, array $params = null):

2._redirect($url, array $options = array()):

$view = new zend_view();

$view->render(‘index.phtml’);

now this will return only render view of this html page so to display it on the screen we have to use either print or echo, so correct way to use this render property is render(‘index.phtml’); ?>

// bad view-script practice: echo $this->variable;

// good view-script practice: echo $this->escape($this->variable);

ErrorHandler and ViewRenderer are plugind for zend_controller_front and to disable that pugins or any plugin use statement and syntex which shows as under

$front = new Zend_Controller_Front

$front-> (‘noErrorHandler’,true);

$front-> (‘noViewRender’,true);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: