Replace if block with switch case for extensibility
This commit is contained in:
@@ -16,19 +16,22 @@ class RippingCluster_Main extends SihnonFramework_Main {
|
|||||||
|
|
||||||
$this->request = new RippingCluster_RequestParser($request_string);
|
$this->request = new RippingCluster_RequestParser($request_string);
|
||||||
|
|
||||||
if (HBC_File == 'index') {
|
switch (HBC_File) {
|
||||||
$this->smarty = new Smarty();
|
case 'index': {
|
||||||
$this->smarty->template_dir = './source/templates';
|
$this->smarty = new Smarty();
|
||||||
$this->smarty->compile_dir = './tmp/templates';
|
$this->smarty->template_dir = './source/templates';
|
||||||
$this->smarty->cache_dir = './tmp/cache';
|
$this->smarty->compile_dir = './tmp/templates';
|
||||||
$this->smarty->config_dir = './config';
|
$this->smarty->cache_dir = './tmp/cache';
|
||||||
|
$this->smarty->config_dir = './config';
|
||||||
|
|
||||||
$this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration'));
|
$this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration'));
|
||||||
|
|
||||||
$this->smarty->assign('version', '0.1');
|
$this->smarty->assign('version', '0.1');
|
||||||
$this->smarty->assign('messages', array());
|
$this->smarty->assign('messages', array());
|
||||||
|
|
||||||
|
$this->smarty->assign('base_uri', $this->base_uri);
|
||||||
|
} break;
|
||||||
|
|
||||||
$this->smarty->assign('base_uri', $this->base_uri);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user