[Solar-svn] Revision 2656
pmjones at solarphp.com
pmjones at solarphp.com
Mon Aug 6 10:47:32 CDT 2007
Branch: Solar_View
* [FIX] New setHelperClass() logic now properly appends _Helper to the default stack class names
* [CHG] Method template() now appends ".php" to the template name if it does not appear; this will allow for things like "include $this->template('foo')" and "echo $this->partial('_bar')".
Modified: branches/orm/Solar/View.php
===================================================================
--- branches/orm/Solar/View.php 2007-07-30 15:37:48 UTC (rev 2655)
+++ branches/orm/Solar/View.php 2007-08-06 15:47:32 UTC (rev 2656)
@@ -301,6 +301,9 @@
{
$parents = array_reverse(Solar::parents($this, true));
array_shift($parents); // drops Solar_Base
+ foreach ($parents as $key => $val) {
+ $parents[$key] = $val . '_Helper';
+ }
$this->_helper_class->set($parents);
$this->_helper_class->add($list);
}
@@ -494,14 +497,23 @@
*/
public function template($name)
{
+ // append ".php" if needed
+ if (substr($name, -4) != '.php') {
+ $name .= '.php';
+ }
+
// get a path to the template
$file = $this->_template_path->find($name);
+
+ // could we find it?
if (! $file) {
throw $this->_exception(
'ERR_TEMPLATE_NOT_FOUND',
array('name' => $name, 'path' => $this->_template_path->get())
);
}
+
+ // done!
return $file;
}
More information about the Solar-svn
mailing list