本文整理汇总了PHP中Phalcon\DI\FactoryDefault::getCookies方法的典型用法代码示例。如果您正苦于以下问题:PHP FactoryDefault::getCookies方法的具体用法?PHP FactoryDefault::getCookies怎么用?PHP FactoryDefault::getCookies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phalcon\DI\FactoryDefault
的用法示例。
在下文中一共展示了FactoryDefault::getCookies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EventsManager
$eventsManager = new EventsManager();
//$eventsManager->attach('dispatch:beforeDispatch', new SecurityPlugin);
//$eventsManager->attach('dispatch:beforeException', new NotFoundPlugin);
$dispatcher = new Dispatcher();
$dispatcher->setEventsManager($eventsManager);
return $dispatcher;
});
//Real-Time notifications checker
$di->set('notifications', function () {
return new NotificationsChecker();
}, true);
//Translation application use Gettext or Native Array
$di->set('translation', function () use($di) {
$language = $di->get('config')->language;
$code = $language->code;
if ($di->getCookies()->has('code')) {
$code = $di->getCookies()->get('code')->getValue();
}
if ($language->gettext) {
$translation = new Gettext(['locale' => $code, 'directory' => ROOT_DIR . 'core/lang', 'defaultDomain' => 'messages']);
} else {
$path = ROOT_DIR . 'core/lang/messages/' . $code . '.php';
if (!file_exists($path)) {
$di->getLogger()->error("You must specify a language file for language '{$code}'");
$path = ROOT_DIR . 'core/lang/messages/en.php';
}
$translation = new NativeArray(['content' => require_once $path]);
}
return $translation;
}, true);
//Queue to deliver e-mails in real-time