public function after(\Asgard\Http\Controller $controller, \Asgard\Http\Request $request, &$result) {
		if(!is_string($result) || $controller->request->header['x-requested-with'] == 'XMLHttpRequest')
			return;
		if($controller->response->getHeader('Content-Type') && $controller->response->getHeader('Content-Type') != 'text/html')
			return;

		if($controller->get('layout') !== false) {
			if(is_callable($controller->get('layout')))
				$result = call_user_func_array($controller->get('layout'), [$controller, $result]);
			elseif(is_string($controller->get('layout')))
				$result = \Asgard\Templating\PHPTemplate::renderFile($controller->get('layout'), ['content'=>$result, 'controller'=>$controller]);
			elseif(is_callable($this->layout))
				$result = call_user_func_array($this->layout, [$controller, $result]);
			elseif(is_string($this->layout))
				$result = \Asgard\Templating\PHPTemplate::renderFile($this->layout, ['content'=>$result, 'controller'=>$controller]);
		}

		if($controller->get('htmlLayout') === false)
			return;
		if(is_callable($controller->get('htmlLayout')))
			$result = call_user_func_array($controller->get('htmlLayout'), [$controller, $result]);
		elseif(is_string($controller->get('htmlLayout')))
			$result = \Asgard\Templating\PHPTemplate::renderFile($controller->get('htmlLayout'), ['content'=>$result, 'controller'=>$controller]);
		elseif(is_callable($this->htmlLayout))
			$result = call_user_func_array($this->htmlLayout, [$controller, $result]);
		elseif(is_string($this->htmlLayout))
			$result = \Asgard\Templating\PHPTemplate::renderFile($this->htmlLayout, ['content'=>$result, 'controller'=>$controller]);
	}
public function after(\Asgard\Http\Controller $controller, \Asgard\Http\Request $request, &$result) {
		if(!is_string($result) || $controller->request->header['x-requested-with'] == 'XMLHttpRequest')
			return;
		if($controller->response->getHeader('Content-Type') && $controller->response->getHeader('Content-Type') != 'text/html')
			return;

		if($controller->get('layout') !== false) {
			if(is_callable($controller->get('layout')))
				$result = call_user_func_array($controller->get('layout'), [$controller, $result]);
			elseif(is_string($controller->get('layout')))
				$result = \Asgard\Templating\PHPTemplate::renderFile($controller->get('layout'), ['content'=>$result, 'controller'=>$controller]);
			elseif(is_callable($this->layout))
				$result = call_user_func_array($this->layout, [$controller, $result]);
			elseif(is_string($this->layout))
				$result = \Asgard\Templating\PHPTemplate::renderFile($this->layout, ['content'=>$result, 'controller'=>$controller]);
		}

		if($controller->get('htmlLayout') === false)
			return;
		if(is_callable($controller->get('htmlLayout')))
			$result = call_user_func_array($controller->get('htmlLayout'), [$controller, $result]);
		elseif(is_string($controller->get('htmlLayout')))
			$result = \Asgard\Templating\PHPTemplate::renderFile($controller->get('htmlLayout'), ['content'=>$result, 'controller'=>$controller]);
		elseif(is_callable($this->htmlLayout))
			$result = call_user_func_array($this->htmlLayout, [$controller, $result]);
		elseif(is_string($this->htmlLayout))
			$result = \Asgard\Templating\PHPTemplate::renderFile($this->htmlLayout, ['content'=>$result, 'controller'=>$controller]);
	}
public function after ( \ Asgard \ Http \ Controller $ controller , \ Asgard \ Http \ Request $ request , & $ result ) { if ( ! is_string ( $ result ) || $ controller -> request -> header [ 'x-requested-with' ] == 'XMLHttpRequest' ) return ; if ( $ controller -> response -> getHeader ( 'Content-Type' ) && $ controller -> response -> getHeader ( 'Content-Type' ) != 'text/html' ) return ; if ( $ controller -> get ( 'layout' ) !== false ) { if ( is_callable ( $ controller -> get ( 'layout' ) ) ) $ result = call_user_func_array ( $ controller -> get ( 'layout' ) , [ $ controller , $ result ] ) ; elseif ( is_string ( $ controller -> get ( 'layout' ) ) ) $ result = \ Asgard \ Templating \ PHPTemplate :: renderFile ( $ controller -> get ( 'layout' ) , [ 'content' => $ result , 'controller' => $ controller ] ) ; elseif ( is_callable ( $ this -> layout ) ) $ result = call_user_func_array ( $ this -> layout , [ $ controller , $ result ] ) ; elseif ( is_string ( $ this -> layout ) ) $ result = \ Asgard \ Templating \ PHPTemplate :: renderFile ( $ this -> layout , [ 'content' => $ result , 'controller' => $ controller ] ) ; } if ( $ controller -> get ( 'htmlLayout' ) === false ) return ; if ( is_callable ( $ controller -> get ( 'htmlLayout' ) ) ) $ result = call_user_func_array ( $ controller -> get ( 'htmlLayout' ) , [ $ controller , $ result ] ) ; elseif ( is_string ( $ controller -> get ( 'htmlLayout' ) ) ) $ result = \ Asgard \ Templating \ PHPTemplate :: renderFile ( $ controller -> get ( 'htmlLayout' ) , [ 'content' => $ result , 'controller' => $ controller ] ) ; elseif ( is_callable ( $ this -> htmlLayout ) ) $ result = call_user_func_array ( $ this -> htmlLayout , [ $ controller , $ result ] ) ; elseif ( is_string ( $ this -> htmlLayout ) ) $ result = \ Asgard \ Templating \ PHPTemplate :: renderFile ( $ this -> htmlLayout , [ 'content' => $ result , 'controller' => $ controller ] ) ; }
To be executed after the action.
@param  \Asgard\Http\Controller $controller
@param  \Asgard\Http\Request    $request
@param  mixed                   $result
To be executed after the action .