Cześć, mam takie controllery:
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. class Controller_App extends Controller_Template {
  4.  
  5. // Default session instance
  6. protected $_session;
  7.  
  8. // Is the request ajax?
  9. protected $_is_ajax;
  10.  
  11. public function __construct(Request $req)
  12. {
  13. // Pass the request to the template controller
  14. parent::__construct($req);
  15.  
  16. // Set the template
  17. $this->template = 'template';
  18.  
  19. // Set the default session instance, this will be used throughout the application
  20. $this->_session = Session::instance();
  21.  
  22. // Is the request ajax?
  23. if (Request::$is_ajax OR $this->request !== Request::instance())
  24. {
  25. $this->_is_ajax = TRUE;
  26. }
  27. }
  28.  
  29. public function before() {
  30. if ($this->_is_ajax === TRUE)
  31. {
  32. $this->auto_render = FALSE;
  33.  
  34. $this->request->headers['Cache-Control'] = 'no-cache, must-revalidate';
  35. $this->request->headers['Expires'] = 'Sun, 30 Jul 1989 19:30:00 GMT';
  36. $this->request->headers['Content-Type'] = 'application/json';
  37. }
  38. else
  39. {
  40. parent::before();
  41. $this->template->title = 'hello, world!';
  42. $this->template->description = 'hello, world!';
  43. $this->template->meta_keywords = 'hello, world!';
  44. $this->template->meta_description = 'hello, world!';
  45. $this->template->meta_description = 'hello, world!';
  46. $this->template->styles = array();
  47. $this->template->scripts = array();
  48. }
  49. }
  50. }

  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. class Controller_User extends Controller_App {
  4.  
  5. public function __construct(Request $req)
  6. {
  7. parent::__construct($req);
  8. }
  9.  
  10. public function action_form()
  11. {
  12. $view = new View('form');
  13. $this->template->content = $view->render(false);
  14. }
  15.  
  16. }

I mam błąd:
Kod
Kohana_View_Exception [ 0 ]: The requested view could not be found

To co mnie zdziwiło to:
Kod
SYSPATH/classes\kohana\view.php [ 294 ]   » Kohana_View->set_filename(arguments)
argumenty:
file     bool FALSE

A gdy zamiast
  1. $view = new View('form');

dam
  1. $view = new View('form.php');

Jest
Kod
SYSPATH/classes\kohana\view.php [ 115 ]   » Kohana_View->set_filename(arguments)
file     string(8) "form.php"

Ale nadal jest błąd
  1. Kohana_View_Exception [ 0 ]: The requested view form.php could not be found

Widok na pewno istnieje.
Co o tym sądzicie ?

Zadziałało View::factory('form') -.-