Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread gabriel
Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages, for instance I want to redirect a page in straight PHP it would be ' header(Location: index.php); ' does any one know how to do this in CAKE ? --~--~-~--~~~---~--~~ You received

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread dr. Hannibal Lecter
Of course, why not :) http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676f61b3039 On Sep 23, 2:00 pm, gabriel [EMAIL PROTECTED] wrote: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages, for instance I want to redirect a page in straight PHP it

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
Hi doc Thanks for the reply, but how do I redirect in a view which does not have a model or controller? On Tue, Sep 23, 2008 at 1:26 PM, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Of course, why not :) http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676f61b3039 On Sep

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread teknoid
You shouldn't do redirects in a view. Seems like an incorrect approach... and btw, you can always use header() if absolutely necessary (although it's probably not). On Sep 23, 10:53 am, Gabriel Kolbe [EMAIL PROTECTED] wrote: Hi doc Thanks for the reply, but how do I redirect in a view which

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Michael
Gabriel, You can put the content of the page in views/pages. They will use the default layout. Your path would be whatever you define in routes.php. For example, Router::connect('/contact', array('controller' = 'pages', 'action' = 'display', 'contact')); In views/pages you would have a PHP

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread dr. Hannibal Lecter
Hi again, as teknoid said, don't redirect from a view. If you've come to a point where you redirect from a view, you should seriously reconsider you coding strategy. Views are supposed to display data, define the look of your app and input forms; but never handle any business or application

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread ORCC
You can issue a header or any php function into the View, but it is not correct from the point of view of the MVC pattern, because it seems that you are putting application logic into the view. --~--~-~--~~~---~--~~ You received this message because you are

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
Hi, my situation is the following: // check if user is logged in... ? if ($session-check('Auth.User.id')) { ? do your thing ? } else { ? redirect page somewhere else ? } ? is is done in a view how, do you mean I have to check the login in the function in the controller ? Regards On Tue, Sep

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
Sorry, just to add to the info below, the view DOES not have a controller or a model, not I don't want to place it in the app_controller, because some page accessable even if you are not logged in.. my problem is I am unexperienced and it is mega frastrating !! On Tue, Sep 23, 2008 at 7:09 PM,

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
thanks On Tue, Sep 23, 2008 at 7:26 PM, teknoid [EMAIL PROTECTED] wrote: Again, this approach is not correct. Checking for user status, should always be done in the controller. Take a look at the auth component in the manual to see how you can restrict access to certain resources/pages.

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread teknoid
Again, this approach is not correct. Checking for user status, should always be done in the controller. Take a look at the auth component in the manual to see how you can restrict access to certain resources/pages. On Sep 23, 2:14 pm, Gabriel Kolbe [EMAIL PROTECTED] wrote: Sorry, just to add