dev-master
9999999-devSmarty template enigine for Slim Framework 3.x
MIT
The Requires
- php >=5.5
- smarty/smarty ~3.1
by huzemin
template smarty view slim view
Smarty template enigine for Slim Framework 3.x
用于Slim Framework 3.x 的Smarty View组件, (*1)
可直接从github上直接下载,放置在项目中, 然后配置composer自动导入。, (*2)
$smarty_config = array( 'templateDir' => 'templateDir', 'compileDir' => 'compileDir'', 'cachedDir' => 'cachedDir', 'configDir' => 'configDir', 'pluginsDir' => array( ... ) ); use \Slim\Views\SmartyView as View; // Setup Slim Framework $app = new App(); $container = $app->getContainer(); $container['view'] = function($c) { $smarty_config = load_config('smarty'); $view = new View($smarty_config); $view->addExtionsions($c,$smarty_config['pluginsDir']); return $view; };
程序借鉴了slimphp/Twig-View的实现方式。 程序可以自由修改!!, (*3)
Smarty template enigine for Slim Framework 3.x
MIT
template smarty view slim view