Haanga_Compiler::setOption PHP Method

setOption() public static method

@return void
public static setOption ( $option, $value ) : void
return void
    public static function setOption($option, $value)
    {
        switch (strtolower($option)) {
            case 'if_empty':
                self::$if_empty = (bool) $value;
                break;
            case 'enable_load':
                self::$enable_load = (bool) $value;
            case 'echo_concat':
                if ($value == '.' || $value == ',') {
                    self::$echo_concat = $value;
                }
                break;
            case 'autoescape':
                self::$autoescape = (bool) $value;
                break;
            case 'dot_as_object':
                self::$dot_as_object = (bool) $value;
                break;
            case 'strip_whitespace':
                self::$strip_whitespace = (bool) $value;
                break;
            case 'is_exec_enabled':
            case 'allow_exec':
                self::$is_exec_enabled = (bool) $value;
                break;
            case 'global':
                if (!is_array($value)) {
                    $value = array($value);
                }
                self::$global_context = $value;
                break;
        }
    }

Usage Example

Beispiel #1
0
 public function init($test_file, &$expected)
 {
     if ($test_file == 'assert_templates/strip_whitespace.tpl') {
         Haanga_Compiler::setOption('strip_whitespace', TRUE);
         $expected = rtrim($expected) . ' ';
         /* weird output */
     } else {
         Haanga_Compiler::setOption('strip_whitespace', FALSE);
     }
 }
All Usage Examples Of Haanga_Compiler::setOption