Overview

Namespaces

  • Deimos
    • Flow
      • Extension
        • TBlock
        • TFor
        • TForeach
        • TIF
        • TLiteral
        • TPHP
        • TSimple
        • TTry
        • TWhile
      • Traits
  • PHP

Classes

  • Deimos\Flow\Block
  • Deimos\Flow\Configure
  • Deimos\Flow\DefaultConfig
  • Deimos\Flow\DefaultContainer
  • Deimos\Flow\Extension\TBlock\TBlockStart
  • Deimos\Flow\Extension\TBlock\TEndBlock
  • Deimos\Flow\Extension\TFor\TEndFor
  • Deimos\Flow\Extension\TFor\TFor
  • Deimos\Flow\Extension\TForeach\TElseForeach
  • Deimos\Flow\Extension\TForeach\TEndForeach
  • Deimos\Flow\Extension\TForeach\TForeach
  • Deimos\Flow\Extension\TIF\TELSE
  • Deimos\Flow\Extension\TIF\TELSEIF
  • Deimos\Flow\Extension\TIF\TEndIF
  • Deimos\Flow\Extension\TIF\TIF
  • Deimos\Flow\Extension\TLiteral\TLiteral
  • Deimos\Flow\Extension\TPHP\TEndPHP
  • Deimos\Flow\Extension\TPHP\TPHP
  • Deimos\Flow\Extension\TSimple\TAssign
  • Deimos\Flow\Extension\TSimple\TBreak
  • Deimos\Flow\Extension\TSimple\TContinue
  • Deimos\Flow\Extension\TSimple\TExtends
  • Deimos\Flow\Extension\TSimple\TInclude
  • Deimos\Flow\Extension\TSimple\TPartial
  • Deimos\Flow\Extension\TSimple\TVariable
  • Deimos\Flow\Extension\TTry\TCatch
  • Deimos\Flow\Extension\TTry\TEndTry
  • Deimos\Flow\Extension\TTry\TFinally
  • Deimos\Flow\Extension\TTry\TTry
  • Deimos\Flow\Extension\TWhile\TEndWhile
  • Deimos\Flow\Extension\TWhile\TWhile
  • Deimos\Flow\Flow
  • Deimos\Flow\FlowForeach
  • Deimos\Flow\FlowFunction
  • Deimos\Flow\ForeachState
  • Deimos\Flow\Lexer
  • Deimos\Flow\LexerConst
  • Deimos\Flow\Tokenizer

Interfaces

  • Throwable

Traits

  • Deimos\Flow\Traits\Block
  • Deimos\Flow\Traits\FileSystem
  • Deimos\Flow\Traits\Tokenizer

Exceptions

  • BadFunctionCallException
  • Exception
  • InvalidArgumentException
  • LogicException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: namespace Deimos\Flow\Extension\TSimple;
 4: 
 5: use Deimos\Flow\FlowFunction;
 6: 
 7: class TAssign extends FlowFunction
 8: {
 9: 
10:     /**
11:      * @var string
12:      */
13:     protected $variable;
14: 
15:     /**
16:      * @var mixed
17:      */
18:     protected $value;
19: 
20:     /**
21:      * init assign
22:      *
23:      * @throws \InvalidArgumentException
24:      */
25:     public function init()
26:     {
27:         array_shift($this->data);
28: 
29:         if (empty($this->data))
30:         {
31:             throw new \InvalidArgumentException('Assign not found variable name');
32:         }
33: 
34:         $this->variable = array_shift($this->data);
35:         array_shift($this->data);
36: 
37:         if (empty($this->data))
38:         {
39:             throw new \InvalidArgumentException('Assign not found variable value');
40:         }
41: 
42:         $this->value = implode($this->data);
43:     }
44: 
45:     /**
46:      * @return string
47:      *
48:      * @throws \InvalidArgumentException
49:      */
50:     public function view()
51:     {
52:         $this->init();
53: 
54:         return '<?php $' . $this->variable . ' = ' . $this->value . '; ?>';
55:     }
56: 
57: }
API documentation generated by ApiGen