Changeset 2492
- Timestamp:
- 04/15/2008 12:57:12 AM (6 months ago)
- Location:
- trunk/system
- Files:
-
- 2 modified
-
i18n/en_US/core.php (modified) (1 diff)
-
libraries/View.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/i18n/en_US/core.php
r2249 r2492 3 3 $lang = array 4 4 ( 5 'there_can_be_only_one' => 'There can be only one instance of Kohana per page request .',5 'there_can_be_only_one' => 'There can be only one instance of Kohana per page request', 6 6 'uncaught_exception' => 'Uncaught %s: %s in file %s on line %s', 7 'invalid_method' => 'Invalid method <tt>%s</tt> called in <tt>%s</tt>.', 8 'cannot_write_log' => 'Your log.directory config setting does not point to a writable directory.', 9 'resource_not_found' => 'The requested %s, <tt>%s</tt>, could not be found.', 10 'invalid_filetype' => 'The requested filetype, <tt>.%s</tt>, is not allowed in your view configuration file.', 11 'no_default_route' => 'Please set a default route in <tt>config/routes.php</tt>.', 7 'invalid_method' => 'Invalid method <tt>%s</tt> called in <tt>%s</tt>', 8 'cannot_write_log' => 'Your log.directory config setting does not point to a writable directory', 9 'resource_not_found' => 'The requested %s, <tt>%s</tt>, could not be found', 10 'invalid_filetype' => 'The requested filetype, <tt>.%s</tt>, is not allowed in your view configuration file', 11 'view_set_filename' => 'You must set the the view filename before calling render', 12 'no_default_route' => 'Please set a default route in <tt>config/routes.php</tt>', 12 13 'no_controller' => 'Kohana was not able to determine a controller to process this request: %s', 13 14 'page_not_found' => 'The page you requested, <tt>%s</tt>, could not be found.', -
trunk/system/libraries/View.php
r2377 r2492 29 29 * @return object 30 30 */ 31 public static function factory($name , $data = NULL, $type = NULL)31 public static function factory($name = NULL, $data = NULL, $type = NULL) 32 32 { 33 33 return new View($name, $data, $type); … … 43 43 * @return void 44 44 */ 45 public function __construct($name, $data = NULL, $type = NULL) 45 public function __construct($name = NULL, $data = NULL, $type = NULL) 46 { 47 if ( ! empty($name)) 48 { 49 // Set the filename 50 $this->set_filename($name, $type); 51 } 52 53 if (is_array($data) AND ! empty($data)) 54 { 55 // Preload data using array_merge, to allow user extensions 56 $this->data = array_merge($this->data, $data); 57 } 58 } 59 60 public function set_filename($name, $type = NULL) 46 61 { 47 62 if (empty($type)) … … 62 77 $this->kohana_filetype = empty($this->kohana_filetype) ? $type : $this->kohana_filetype; 63 78 } 64 65 if (is_array($data) AND ! empty($data))66 {67 // Preload data using array_merge, to allow user extensions68 $this->data = array_merge($this->data, $data);69 }70 71 Log::add('debug', 'View Class Initialized ['.$name.']');72 79 } 73 80 … … 181 188 public function render($print = FALSE, $renderer = FALSE) 182 189 { 190 if (empty($this->kohana_filename)) 191 throw new Kohana_Exception('core.view_set_filename'); 192 183 193 if (is_string($this->kohana_filetype)) 184 194 {
