$this->cakeError("error401", array("message" => "activate a Termolino word")); //message is variable name
second parameter is list of variables to be set for set() function for variables in view :D
--
LP,
Tilen Majerle http://majerle.eu
2010/8/27 Joshua Muheim <psybear83@gmail.com>
Wow, much better now! But I still having problems to get the message (2nd parameter) from
$this->cakeError("error401", "activate a Termolino word");
into my view. Any idea? Thanks!
On Fri, Aug 27, 2010 at 2:54 PM, Tilen Majerle <tilen.majerle@gmail.com> wrote:this u will need...
function error401($params){//$this->controller->layout = "error_layout"; //if u want to change layout$this->controller->set($params); //set variables$this->_outputMessage("error401"); //output error element}2010/8/27 Tilen Majerle <tilen.majerle@gmail.com>i'm not sure...but u need to do thisclass AppError extends ErrorHandler {$this->_outputMessage("error401"); //where error401 is your template name
function error401() {
}
}
--
LP,
Tilen Majerle http://majerle.eu
2010/8/27 psybear83 <psybear83@gmail.com>Hi all
I want to display a 401 error, so I created an app/app_error.php file
with the following content:
<?php
class AppError extends ErrorHandler {
function error401() {
}
}
?>
And I created a view app/views/errors/error401.ctp with the following
content:
<h2><?php echo $name; ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("You are not authorized to %s.", true),
"<strong>'{$message}'</strong>")?>
</p>
Then I call the error using:
$this->cakeError("error401");
But I'm still getting the default 401 error... (or at least not my
own!)
What could be the problem here?
Thanks a lot for help
Josh
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment