本文整理汇总了PHP中Slim::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::__construct方法的具体用法?PHP Slim::__construct怎么用?PHP Slim::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slim
的用法示例。
在下文中一共展示了Slim::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct(array('templates.path' => TEMPLATE_PATH, 'view' => new RainTplView()));
$this->container->singleton('mysuperclass', function ($container) {
return new MySuperClass();
});
}
示例2: __construct
/**
* Constructor
* calls parent Slim::__construct
* @param array $userSettings
* @return void
*/
public function __construct($userSettings = array())
{
$this->settings = array_merge_recursive(array('meta' => array('title' => 'Slimplr Framework', 'about' => 'A fork of http://www.slimframework.com/'), 'templates.path' => './templates', 'templates.default' => 'page_html5.php', 'navigation' => array('main' => array('filter' => array('status' => 'online'), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'nested'), 'global' => array('filter' => array('status' => 'online'), 'selection' => array('global' => "true"), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'nested'), 'breadcrumb' => array('filter' => array('status' => 'online'), 'selection' => array('first' => 1, 'current' => 1, 'parent' => 1), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'linear'), 'context' => array('filter' => array('status' => 'online'), 'selection' => array('current' => 1, 'child' => 1, 'brother' => 1), 'level' => array('start' => 0, 'depth' => 100), 'modus' => 'nested'))), $userSettings);
parent::__construct($this->settings);
#show($this->settings['meta']['about']);
#show($this->settings['mode']);
#show($this->request);
$this->getRouting();
#$this->run();
}
示例3: __construct
public function __construct($userSettings = array())
{
parent::__construct($userSettings);
$this->add(new Slim_Middleware_SessionCookie());
$this->config('db', $this->initDb());
$this->config('source', $this->initSource());
$this->view()->appendData(array(
'app' => $this,
'translation' => include 'assets/translation/de.php',
'language' => 'de'
));
$app = $this;
$this->get('/', function () use ($app) {
$app->render('index.php', array(
'action' => 'index'
));
})->via('GET', 'POST')->name('index');
$this->get('/system', function () use ($app) {
$system = new Shopware_Components_Check_System();
$app->render('system.php', array(
'action' => 'system',
'system' => $system,
'error' => false
));
})->via('GET', 'POST')->name('system');
$this->get('/update', function () use ($app) {
echo "SET NAMES 'utf8';\n";
echo "SET FOREIGN_KEY_CHECKS = 0;\n";
echo "ALTER DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;\n\n";
$export = new Shopware_Components_DbDiff_Mysql(
$this->config('source'),
$this->config('db')
);
$tables = $export->listTables();
foreach($tables as $table) {
echo $export->getTableUpdate($table);
}
})->via('GET', 'POST')->name('backup');
$this->get('/backup', function () use ($app) {
$skipTables = array(
's_articles_translations',
's_search_index',
's_search_keywords',
's_core_log',
's_core_sessions'
);
echo "SET NAMES 'utf8';\n";
echo "SET FOREIGN_KEY_CHECKS = 0;\n\n";
$export = new Shopware_Components_DbExport_Mysql(
$this->config('db')
);
$tables = $export->listTables();
foreach($tables as $table) {
$export->setTable($table);
foreach($export as $line) {
echo $line;
if(in_array($table, $skipTables)) {
break;
}
}
}
})->via('GET', 'POST')->name('backup');
//Shopware_Components_DbExport_Mysql
}
示例4: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
}