Skip to content

Commit 69b888c

Browse files
author
James Watts
committed
Updated objects to implement CtkRenderable
1 parent de27d8c commit 69b888c

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Lib/CtkContent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,12 @@ final public function allowsEvents() {
357357
}
358358

359359
/**
360-
* Loads the template for the node.
360+
* Parses the template for the node.
361361
*
362362
* @param string $path Path to the template.
363363
* @return string
364364
*/
365-
final public function load($path) {
365+
final public function template($path) {
366366
return '';
367367
}
368368

Lib/CtkElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ final public function allowsEvents() {
394394
}
395395

396396
/**
397-
* Loads the template for the node.
397+
* Parses the template for the node.
398398
*
399399
* @param string $path Path to the template.
400400
* @return string
401401
*/
402-
final public function load($path) {
402+
final public function template($path) {
403403
return '';
404404
}
405405

Lib/CtkEvent.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ abstract class CtkEvent extends CtkObject implements CtkRenderable {
8787
* @param array $params The optional configuration parameters for the template.
8888
*/
8989
final public function __construct(CtkFactory $factory, array $params = array()) {
90+
parent::__construct();
9091
$this->_factory = $factory;
9192
$this->_name = str_replace($factory->getName(), '', get_class($this));
9293
$this->_inheritArrayProperties(array('_params', '_validate'));
@@ -232,20 +233,22 @@ final public function bindTo($type, CtkBindable $node) {
232233
}
233234

234235
/**
235-
* Loads the template for the event.
236+
* Parses the template for the event.
236237
*
237238
* @param string $path Path to the template.
238239
* @return string
239240
* @throws CakeException if template is not found.
240241
*/
241-
final public function load($path) {
242+
final public function template($path) {
243+
if (!is_string($path)) {
244+
throw new CakeException('Template path must be a string');
245+
}
242246
if (is_file($path) && is_readable($path)) {
243247
ob_start();
244248
require $path;
245249
return ob_get_clean();
246-
} else {
247-
throw new CakeException(sprintf('Template not found: %s', $path));
248250
}
251+
throw new CakeException(sprintf('Template not found: %s', $path));
249252
}
250253

251254
/**

Lib/CtkNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,13 +902,13 @@ final public function clearEvents($type = null) {
902902
}
903903

904904
/**
905-
* Loads the template for the node.
905+
* Parses the template for the node.
906906
*
907907
* @param string $path Path to the template.
908908
* @return string
909909
* @throws CakeException if template is not found.
910910
*/
911-
final public function load($path) {
911+
final public function template($path) {
912912
if (!is_string($path)) {
913913
throw new CakeException('Template path must be a string');
914914
}

View/Helper/FactoryHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public function __construct(View $View, $settings = array()) {
106106
}
107107
$factory = new $class($this->_view, $name, $plugin, $value);
108108
$factory->setup();
109+
$factory->load();
109110
$property = ($isAlias)? $key : $name;
110111
$this->$property = new CtkFactoryAdaptor($factory);
111112
}

0 commit comments

Comments
 (0)