Davide wrote:
> ...
> How can I render the correct page without doing a redirect?
At the moment I've solved in this way. Don't know if it's the right
way but it's working.
Thanks a lot
Bye
Davide
<?php
/*
* app/error.php
*/
class AppError extends ErrorHandler{
function missingAction($params){
switch($params["className"]){
case "ProjectsController":
loadModel("Project");
$model = new Project();
$data = $model->findByName($params["action"]);
if(is_null($data) || empty($data)){
parent::missingAction($params);
}else{
$this->controller->webroot = $params["webroot"];
$this->controller->set("content_for_layout",$this->requestAction("/projects/view/".$data["Project"]["id"],
array("return")));
$this->controller->pageTitle = $data["Project"]["name"];
$this->controller->viewPath = "layouts";
$this->controller->render("ajax");
}
break;
default:
parent::missingAction($params);
break;
}
}
}
?>
--
Live life like you're gonna die. Because you're gonna.
William Shatner
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---