There is a controller associated with the route, probably it is called index! Your view is invoked by the controller, so which controller are you using for the admin?
Please someone else correct me, if I am wrong about this! As far as I know, you can't invoke a view, just by having a route - it has to go through a controller! Enjoy, John On Jan 3, 12:40 pm, Lorenzo Bettini <[email protected]> wrote: > well that was a view linked directly by the router, e.g., > > /admin > > thus there's no controller action associated to that... > > Lorenzo > > > > John Andersen wrote: > > Make the check in the controller and do the redirect from there! > > Enjoy, > > John > > > On Jan 2, 7:01 pm, Lorenzo Bettini <[email protected]> wrote: > >> Hi > > >> is there a way to perform a redirect from inside a view? > > >> For instance if the user is not logged. > > >> I can do this manually like this: > > >> <?php > >> if (!$session->check('User')) { > >> header ("Location: ".$html->url('/'));} > > >> ?> > > >> but I was wondering if there was a more "cake" way to do this. > > >> thanks in advance > >> Lorenzo > > -- > Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino > HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com > BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com 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
