當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。