I have this code for my app, and I need to put it in a few controllers.
I wonder where I can put it, so I could call it from the controllers.

loadModel('Section');
$Section =& new Section;
$this->Section =& new Section;

$this->Section->id = $this->params['url']['section'];
$section = $this->Section->read();

if($section==FALSE) {
        $this->Session->setFlash('Section doesn\'t exist, displaying sections
index.');
        $this->redirect('/admin/sections/');
}

I tried putting it in a component, but I couldn't access
$this->Session->..


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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