Latte\Compiler::setContext PHP Method

setContext() public method

public setContext ( $context )
    public function setContext($context)
    {
        trigger_error(__METHOD__ . ' is deprecated.', E_USER_DEPRECATED);
        $this->context = $context;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * New node is found.
  * @return bool
  */
 public function nodeOpened(MacroNode $node)
 {
     list($begin, $end, $attr) = $this->macros[$node->name];
     $node->isEmpty = !$end;
     if ($attr && $node->prefix === $node::PREFIX_NONE) {
         $node->isEmpty = TRUE;
         $this->compiler->setContext(Latte\Compiler::CONTEXT_DOUBLE_QUOTED_ATTR);
         $res = $this->compile($node, $attr);
         if ($res === FALSE) {
             return FALSE;
         } elseif (!$node->attrCode) {
             $node->attrCode = "<?php {$res} ?>";
         }
         $this->compiler->setContext(NULL);
     } elseif ($begin) {
         $res = $this->compile($node, $begin);
         if ($res === FALSE || $node->isEmpty && $node->prefix) {
             return FALSE;
         } elseif (!$node->openingCode) {
             $node->openingCode = "<?php {$res} ?>";
         }
     } elseif (!$end) {
         return FALSE;
     }
 }
All Usage Examples Of Latte\Compiler::setContext