Ticket #771 (closed Patch: fixed)
Smarty module patch for bug w/ partials
| Reported by: | ixmatus | Owned by: | armen |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.2.1 |
| Component: | Modules | Version: | SVN HEAD |
| Keywords: | smarty module modules bug patch | Cc: |
Description
Inside MY_View.php of the the Smarty module, this line prevents partials from properly being sharded into templates:
... 7 $type = NULL; ...
To fix the issue, I made the code a little bit more flexible:
class View extends View_Core {
public function __construct($name, $data = NULL, $type = NULL)
{
if (Kohana::config('smarty.integration') == TRUE AND Kohana::find_file('views', $name, FALSE, is_null($type)?'tpl':$type))
{
$type = empty($type) ? Kohana::config('smarty.templates_ext') : 'tpl';
}
parent::__construct($name, $data, $type);
}
}
Partials are now loaded properly with their .tpl extensions when no extension is provided in the view lib constructor...
Change History
Note: See
TracTickets for help on using
tickets.
