All pastes #739525 Raw Edit

Untitled

public php v1 · immutable
·published 2007-10-17 07:11 UTC
rendered paste body
<?phpclass Post_Controller_Hook{	var $CI;	function __construct()	{		$this->CI =& get_instance();	}	/**	 * Runs the post controller actions	 *	 * @access public	 */	function run()	{		$this->set_cookie_defaults();		$this->set_view_defaults();		$this->draw_page();	}	/**	 * Loads the parent view	 *	 * @access private	 */	private function draw_page()	{		$this->CI->mysmarty->assign('elapsed_time',$this->CI->benchmark->elapsed_time('','',2));		$this->CI->mysmarty->display('parent.tpl');	}	/**	 * Sets default view variables	 *	 * @access private	 */	private function set_view_defaults()	{		// Create a title based on the uri segments if none is set//		if (!$this->CI->view->get('title'))	$this->CI->view->set('title',//													str_replace('_', ' ',//														ucwords(//															implode(' - ',//																$this->CI->uri->segment_array()//													))));	}	/**	 * Sets default cookie variables	 *	 * @access private	 */	private function set_cookie_defaults()	{		$this->CI->session->set_userdata('last_uri', $this->CI->uri->uri_string());	}}?>