Haanga_Compiler::generate_op_if PHP Method

generate_op_if() protected method

{% if %} HTML {% else %} TWO {% endif $} {{{
protected generate_op_if ( $details, &$body )
    protected function generate_op_if($details, &$body)
    {
        if (self::$if_empty && $this->is_var_filter($details['expr']) && count($details['expr']['var_filter']) == 1) {
            /* if we are doing if <Variable> it should check 
               if it exists without throw any warning */
            $expr = $details['expr'];
            $expr['var_filter'][] = 'empty';
            $variable = $this->get_filtered_var($expr['var_filter'], $var);
            $details['expr'] = hexpr($variable, '===', FALSE)->getArray();
        }
        $this->check_expr($details['expr']);
        $expr = Haanga_AST::fromArrayGetAST($details['expr']);
        $body->do_if($expr);
        $this->generate_op_code($details['body'], $body);
        if (isset($details['else'])) {
            $body->do_else();
            $this->generate_op_code($details['else'], $body);
        }
        $body->do_endif();
    }