Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-20-2007, 04:01 AM
Junior Member
 
Join Date: Feb 2007
Posts: 26
Default Auto Render question

Hi again,

in my IndexController.php

Code:
class IndexController extends Zend_Controller_Action {
		
	public function init(){
		$this->view->actionTemplate = $this->getViewScript();
	}
		
    	public function indexAction(){
    		$this->view->title = 'Index, Index';
    		$this->render('site',null,true);
    	}

        public function loginAction(){
    		$this->view->title = 'Index, Login';
    		$this->render('site',null,true);
    	}
    	
    	public function logoutAction(){
    		$this->view->title = 'Index, Logout';
    		$this->render('site',null,true);
    	}
    	
    	public function searchAction(){
    		$this->view->title = 'Index, Search';
    		$this->render('site',null,true);
    	}
}
site.phtml consist of everything including CSS and JavaScript. here is the code in site.phtml (in views/scripts folder)
Code:
<?php echo $this->render($this->actionTemplate); ?>
Notice the code
Code:
$this->render('site',null,true);
is repeated frequently between actions.

My question, how can I make some kind of Auto-Renderer? So I dont have to type $this->render('site',null,true); again and again.

Thx a lot.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:59 PM.