當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Twig_Node_Expression類代碼示例

本文整理匯總了PHP中Twig_Node_Expression的典型用法代碼示例。如果您正苦於以下問題:PHP Twig_Node_Expression類的具體用法?PHP Twig_Node_Expression怎麽用?PHP Twig_Node_Expression使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Twig_Node_Expression類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(Twig_Node_Expression $node, $name, $lineno)
 {
     parent::__construct(array('node' => $node), array('name' => $name, 'safe' => false), $lineno);
     if ($node instanceof Twig_Node_Expression_Name) {
         $node->setAttribute('always_defined', true);
     }
 }
開發者ID:superdav42,項目名稱:Twig,代碼行數:7,代碼來源:GetProperty.php

示例2: addElement

 public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null)
 {
     if (null === $key) {
         $key = new Twig_Node_Expression_Constant(++$this->index, $value->getLine());
     }
     array_push($this->nodes, $key, $value);
 }
開發者ID:PieterSwitten,項目名稱:webandmobile,代碼行數:7,代碼來源:Array.php

示例3: __construct

 public function __construct(Twig_Node_Expression $node, $method, Twig_Node_Expression_Array $arguments, $lineno)
 {
     parent::__construct(array('node' => $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno);
     if ($node instanceof Twig_Node_Expression_Name) {
         $node->setAttribute('always_defined', true);
     }
 }
開發者ID:jothatron,項目名稱:xvwa,代碼行數:7,代碼來源:MethodCall.php

示例4: __construct

 public function __construct(Twig_Node_Expression $expr1, Twig_Node_Expression $expr2, Twig_Node_Expression $expr3, $lineno)
 {
     parent::__construct($lineno);
     $this->expr1 = $expr1;
     $this->expr2 = $expr2;
     $this->expr3 = $expr3;
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:7,代碼來源:Conditional.php

示例5: __construct

 public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression $arguments = null, $type, $lineno)
 {
     $nodes = array('node' => $node, 'attribute' => $attribute);
     if (null !== $arguments) {
         $nodes['arguments'] = $arguments;
     }
     parent::__construct($nodes, array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno);
 }
開發者ID:vgrish,項目名稱:twiggy,代碼行數:8,代碼來源:GetAttr.php

示例6: __construct

 public function __construct(Twig_Node_Expression_Filter $node)
 {
     if (!self::isDefaultFilter($node)) {
         throw new Twig_Error('The default filter node cannot be created from the given node.', $node->getLine());
     }
     $test = new Twig_Node_Expression_Test(clone $node->getNode('node'), 'defined', new Twig_Node(), $node->getLine());
     $default = count($node->getNode('arguments')) ? $node->getNode('arguments')->getNode(0) : new Twig_Node_Expression_Constant('', $node->getLine());
     $node = new Twig_Node_Expression_Conditional($test, $node, $default, $node->getLine());
     parent::__construct(array('node' => $node), array(), $node->getLine());
 }
開發者ID:bigjoevtrj,項目名稱:codeigniter-bootstrap,代碼行數:10,代碼來源:DefaultFilter.php

示例7: __construct

 public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno)
 {
     parent::__construct(array('node' => $node, 'arguments' => $arguments), array('name' => $name), $lineno);
     // defined is a special case
     if ('defined' === $name) {
         if ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr) {
             $node->setAttribute('is_defined_test', true);
         } else {
             throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine());
         }
     }
 }
開發者ID:ryanhughes,項目名稱:Twig,代碼行數:12,代碼來源:Test.php

示例8: __construct

 public function __construct(\Twig_Node $left, \Twig_Node $right, $lineno)
 {
     $arguments = [];
     foreach ([$left, $right] as $node) {
         if ($node instanceof Arguments) {
             $arguments[] = $node->getArguments();
         } elseif ($node instanceof \Twig_Node_Expression_Name) {
             $arguments[] = [$node->getAttribute('name')];
         } else {
             throw new \InvalidArgumentException('Invalid argument.');
         }
     }
     $this->arguments = array_merge($arguments[0], $arguments[1]);
     parent::__construct(array('left' => $left, 'right' => $right), array(), $lineno);
 }
開發者ID:dpolac,項目名稱:twig-lambda,代碼行數:15,代碼來源:Arguments.php

示例9: __construct

 public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression $arguments = null, $type, $lineno)
 {
     parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => true), $lineno);
 }
開發者ID:sweetroll,項目名稱:craft-test,代碼行數:4,代碼來源:GetAttr.php

示例10: __construct

 /**
  * Constructor.
  *
  * @param \Twig_Node_Expression $variables
  * @param int                   $lineno
  * @param string                $tag
  */
 public function __construct(\Twig_Node_Expression $variables, $lineno, $tag = null)
 {
     $attr = array('variables' => $variables);
     parent::__construct(array(), $attr, $lineno, $tag);
 }
開發者ID:sonatra,項目名稱:SonatraMailerBundle,代碼行數:12,代碼來源:ParentLayoutNode.php

示例11: __construct

 public function __construct(Twig_Node $node, $attr, $arguments, $lineno, $token_value)
 {
     parent::__construct($lineno);
     $this->node = $node;
     $this->attr = $attr;
     $this->arguments = $arguments;
     $this->token_value = $token_value;
 }
開發者ID:skoop,項目名稱:MediTerra,代碼行數:8,代碼來源:GetAttr.php

示例12: __construct

 /**
  * @param Twig_Node|null $template
  */
 public function __construct(Twig_NodeInterface $name, $template = null, $lineno, $tag = null)
 {
     if (is_bool($template)) {
         @trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED);
         $template = null;
     }
     $nodes = array('name' => $name);
     if (null !== $template) {
         $nodes['template'] = $template;
     }
     parent::__construct($nodes, array('is_defined_test' => false, 'output' => false), $lineno, $tag);
 }
開發者ID:richlove1,項目名稱:avc-october,代碼行數:15,代碼來源:BlockReference.php

示例13: __construct

 public function __construct($name, $lineno)
 {
     parent::__construct(array(), array('name' => $name, 'is_defined_test' => false), $lineno);
 }
開發者ID:ryanhughes,項目名稱:Twig,代碼行數:4,代碼來源:Name.php

示例14: __construct

 public function __construct($elements, $lineno)
 {
     parent::__construct($lineno);
     $this->elements = $elements;
 }
開發者ID:skoop,項目名稱:MediTerra,代碼行數:5,代碼來源:Array.php

示例15: __construct

 public function __construct(Twig_NodeInterface $left, Twig_NodeInterface $right, $lineno)
 {
     parent::__construct(array('left' => $left, 'right' => $right), array(), $lineno);
 }
開發者ID:BozzaCoon,項目名稱:SPHERE-Framework,代碼行數:4,代碼來源:Binary.php


注:本文中的Twig_Node_Expression類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。