On Jun 26, 2007, at 10:43 AM, migloth wrote:
> > I recently downloaded CakePHP release 1.2. > > When I attempted to access the $controller member of the View object > ($this->controller), I get a message similar to the following. > > Fatal error: Call to a member function on a non-object in /somesite/ > htdocs/app/views/elements/someElement.thtml on line 2 > The code for someElement.thtml is: > <?php > $user = $this->controller->someMethod(); > . > . > . > ?> > > I started poking around and discovered that the View constructor never > initializes the $controller variable in release 1.2. > > It is initialized in release 1.1.x.x. > > Is this by design? Yes - allowing the view layer to have full access to the controller layer violates MVC tenets. What did you need the controller object for? -- John --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---