I can’t seem to chain some actions together, specifically this line of code:
$messages = Request::factory('messages/get_messages')->execute()->response;
When I play this in my browser, Kohana fails with the following warning.
ErrorException [ Notice ]: Undefined property: Response::$response
The full line of code for this reads…
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Profile extends Controller_Application
{
public function action_index()
{
$content = View::factory('profile/public')
->set('username', 'Test User')
->bind('messages', $messages);
$messages = Request::factory('messages/get_messages')->execute()->response;
$this->template->content = $content;
}
}
Since I’ve been going through Beginners Guide by Jason D. Straughan, there have been a few little differences that I’ve been able to resolve but drawing a blank on this. Any pointers here would be appreciated.
This line of code is on page 81 of the book (jump to page 96 on the scribd viewer).
Try using:
The reason you get the
Notice erroris that the objectResponse(which is returned byRequest::factory(...)->execute()) has no property called$response( Kohana Docs 3.1 | Response OR Kohana Docs 3.2 | Response ).