mathmarques / Smarty-View

Slim Framework 3 view layer built on top of Smarty
MIT License
24 stars 15 forks source link

Registers a resource to fetch a template #5

Closed elvispdosreis closed 7 years ago

elvispdosreis commented 8 years ago

http://www.smarty.net/docs/en/api.register.resource.tpl

Please implement the resource method So we can get template from custom methods and database

/**
 * Unregister a resource
 *
 * @param string $type name of resource
 */
public function unregisterResource($type)
{
    $this->smarty->unregisterResource($type);
}

/**
 * Registers a resource to fetch a template
 *
 * @param string $type      name of resource
 * @param array  $functions array of functions to handle resource
 */
public function registerResource($type, $functions)
{
    $this->smarty->registerResource($type, $functions);
}
mathmarques commented 7 years ago

For now you can do something like:

$smarty = $view->getSmarty();
$smarty->unregisterResource($type);