Thanks Okalany,

Actually, i should have worked this out from the page i posted,

>From the cookbook (similar to your code)
function initialize(&$controller, $settings = array()) {
                // saving the controller reference for later use
                $this->controller =& $controller;
        }

But in my tail chasing I'd added further code that was leading to
misinterpreted error messages.  My bad.

Thanks for helping me see.

will


On Oct 19, 6:53 pm, Okalany Daniel <dokala...@gmail.com> wrote:
> 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 <willjbar...@gmail.com> 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 sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to