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


PHP Twig_ExtensionInterface::getName方法代码示例

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


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

示例1: addExtension

 /**
  * Registers an extension.
  *
  * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
  */
 public function addExtension(Twig_ExtensionInterface $extension)
 {
     $this->extensions[$extension->getName()] = $extension;
     $this->parsers = null;
     $this->visitors = null;
     $this->filters = null;
     $this->tests = null;
     $this->functions = null;
     $this->globals = null;
 }
开发者ID:basdog22,项目名称:Qool,代码行数:15,代码来源:Environment.php

示例2: addExtension

 /**
  * Registers an extension.
  *
  * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
  */
 public function addExtension(Twig_ExtensionInterface $extension)
 {
     if ($this->extensionInitialized) {
         throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
     }
     $this->extensions[$extension->getName()] = $extension;
 }
开发者ID:tschifftner,项目名称:Magento-MEP,代码行数:12,代码来源:Environment.php

示例3: addExtension

 public function addExtension(Twig_ExtensionInterface $extension)
 {
     $this->extensions[$extension->getName()] = $extension;
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:4,代码来源:Environment.php

示例4: addExtension

 /**
  * Registers an extension.
  *
  * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
  */
 public function addExtension(Twig_ExtensionInterface $extension)
 {
     $name = $extension->getName();
     if ($this->extensionInitialized) {
         throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $name));
     }
     if (isset($this->extensions[$name])) {
         @trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $name), E_USER_DEPRECATED);
     }
     $this->lastModifiedExtension = 0;
     $this->extensions[$name] = $extension;
 }
开发者ID:rogerioleal1,项目名称:ci_base,代码行数:17,代码来源:Environment.php

示例5: addExtension

 /**
  * Registers an extension.
  *
  * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
  */
 public function addExtension(Twig_ExtensionInterface $extension)
 {
     $name = $extension->getName();
     if ($this->extensionInitialized) {
         throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $name));
     }
     if (isset($this->extensions[$name])) {
         throw new LogicException(sprintf('Unable to register extension "%s" as it is already registered.', $name));
     }
     $this->lastModifiedExtension = 0;
     $this->extensions[$name] = $extension;
 }
开发者ID:PieterSwitten,项目名称:webandmobile,代码行数:17,代码来源:Environment.php

示例6: addExtension

 public function addExtension(Twig_ExtensionInterface $extension)
 {
     if ($this->extensionInitialized) {
         throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
     }
     $class = get_class($extension);
     if ($class !== $extension->getName()) {
         if (isset($this->extensions[$extension->getName()])) {
             unset($this->extensions[$extension->getName()], $this->extensionsByClass[$class]);
             @trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $extension->getName()), E_USER_DEPRECATED);
         }
     }
     $this->lastModifiedExtension = 0;
     $this->extensionsByClass[$class] = $extension;
     $this->extensions[$extension->getName()] = $extension;
     $this->updateOptionsHash();
 }
开发者ID:kstefanini,项目名称:ep-plugin,代码行数:17,代码来源:Environment.php

示例7: addExtension

 /**
  * Registers an extension.
  *
  * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
  */
 public function addExtension(Twig_ExtensionInterface $extension)
 {
     if ($this->extensionInitialized) {
         throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
     }
     $r = new ReflectionObject($extension);
     if (($extensionTime = filemtime($r->getFileName())) > $this->lastModifiedExtension) {
         $this->lastModifiedExtension = $extensionTime;
     }
     $this->extensions[$extension->getName()] = $extension;
 }
开发者ID:enigmatic-user,项目名称:resellershop,代码行数:16,代码来源:Environment.php


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