当前位置: 首页>>代码示例>>PHP>>正文


PHP Symphony::Cookie方法代码示例

本文整理汇总了PHP中Symphony::Cookie方法的典型用法代码示例。如果您正苦于以下问题:PHP Symphony::Cookie方法的具体用法?PHP Symphony::Cookie怎么用?PHP Symphony::Cookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symphony的用法示例。


在下文中一共展示了Symphony::Cookie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialiseCookie

 /**
  * Setter for `$Cookie`. This will use PHP's parse_url
  * function on the current URL to set a cookie using the cookie_prefix
  * defined in the Symphony configuration. The cookie will last two
  * weeks.
  *
  * This function also defines two constants, `__SYM_COOKIE_PATH__`
  * and `__SYM_COOKIE_PREFIX__`.
  *
  * @deprecated Prior to Symphony 2.3.2, the constant `__SYM_COOKIE_PREFIX_`
  *  had a typo where it was missing the second underscore. Symphony will
  *  support both constants, `__SYM_COOKIE_PREFIX_` and `__SYM_COOKIE_PREFIX__`
  *  until Symphony 3.0
  */
 public static function initialiseCookie()
 {
     $cookie_path = @parse_url(URL, PHP_URL_PATH);
     $cookie_path = '/' . trim($cookie_path, '/');
     define_safe('__SYM_COOKIE_PATH__', $cookie_path);
     define_safe('__SYM_COOKIE_PREFIX_', self::Configuration()->get('cookie_prefix', 'symphony'));
     define_safe('__SYM_COOKIE_PREFIX__', self::Configuration()->get('cookie_prefix', 'symphony'));
     self::$Cookie = new Cookie(__SYM_COOKIE_PREFIX__, TWO_WEEKS, __SYM_COOKIE_PATH__);
 }
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:23,代码来源:class.symphony.php


注:本文中的Symphony::Cookie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。