Hi Will,
I always redirect like this:
$this->controller = null;
// function run on init
function startup(&$controller){
$this->controller = $controller;
}
function someredirect(){
$this->controller->redirect('/');
}
On Tue, Oct 19, 2010 at 10:35 AM, #2Will <[email protected]> wrote:
> Hi,
>
> Im trying to redirect from a component, and in the cookbook it says
> this:
>
> function redirectSomewhere($value) {
> // utilizing a controller method
> $this->controller->redirect($value);
> }
>
>
> http://book.cakephp.org/view/64/Creating-Components
>
> But that throws an error like this:
> **********
> Error: The component file was not found.
>
> Error: Create the class RedirectComponent in file: app/controllers/
> components/redirect.php
>
> <?php
> class RedirectComponent extends Object {
>
>
> }
> ?>
> ***********
>
> Can anyone explain why? And what do i do to redirect from my
> component?
>
> Thanks!
>
> Will
>
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
> more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
--
OKALANY DANIEL,
P.O BOX 26150,
Kampala.,
Uganda.
http://okasoft.net
--
When confronted by our worst nightmares, the choices are few; Fight or
flight. We hope to find the strength to stand against our fears but
sometimes, despite ourselves, we run. What if the nightmare gives chase?
Where can we hide then?
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 [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