I want to check that a url/id is valid in a before render function and was
wondering how to go about it.
 
So if a user types in an address site/posts/some_id_here
 
it will check the "some_id_here" against the db to see if it exists
 
i have 
function beforeRender()
{
          if ($this->Post->validURL($post_id) == false) {
            $this->redirect(array('controller' => 'posts', 'action' =>
'index'));
        }
}
 
but i get $post_id is undefined variable
 
How do I pass the $post_id to a before function? Much easier to verify it in
1 place than have to run the verify function in every action in the
controller.
 
Dave 

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to