$MenuModel = & new MenuModel(); ?

Is all the code in same function ? Maybe ahve a look to
ClassRegistry::Init('MenuModel', 'Model'), I think it does the add
object and returns the class ...(to verify)

On Jan 10, 5:54 pm, lordG <[EMAIL PROTECTED]> wrote:
> Yeah, i've been trying that, but I am not sure if that is or isn't
> related to the error.
>
> The code I have that seems to get nailed is as soon as I do the
> "$MenuModel = new MenuModel();":
>
>                 if (!is_object($this->MenuModel)) {
>                         if (!ClassRegistry::isKeySet('MenuModel')) {
>                                 //get the language model
>                                 if (!class_exists('MenuModel')) {
>                                         App::import('Model','cms.MenuModel');
>                                 }
>                                 $MenuModel = new MenuModel();
>                                 ClassRegistry::addObject('MenuModel', 
> $MenuModel);
>                         }
>                         $this->MenuModel =& 
> ClassRegistry::getObject('MenuModel');
>                 }
>
> AND stripped the MenuModel down to basics
>
> class MenuModel extends CmsAppModel
> {
>         public $name = 'MenuModel';
>         public $useTable = 'cms_menu';
>
> }
>
> And I still get the Stack overflow error.
>
> I did print_r and exit test in between the code above and only hit the
> error at "$MenuModel = new MenuModel();"
>
> Side note: are there any other methods of retreiving the App:import
> class files or any other way I should be doing the "= new ..."?
--~--~---------~--~----~------------~-------~--~----~
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