hey guys,

i need to check whether an ID exists in another model or not.

i wonder which is the correct way to do that:
1) calling a request action, or
2) loading the model itself and making the operation.

1)
if($this->requestAction('/admin/sections/exists/' .$_GET['section'])) {
        echo 'Exists..';
}
else echo 'Doesnt Exist..';

2)
loadModel('Section');
$Section =& new Section;
$this->Section =& new Section;
$Section->id = $_GET['section'];
if($Section->exists()==TRUE) echo $_GET['section'] .':Exists';
else echo $_GET['section'] .':Doesnt Exist';


i assume 2 is the better way to go, but i wanna hear your opinions!

marry xmas :)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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