public function process(array $rules, array $data) {
        
        // If conditionning
        $this->rules[] = new Rule(
            'if_boolean', 
            'if:(\w+)', 
            '<?php if (isset($this->data[\'$1\']) && $this->data[\'$1\']): ?>'
        );
        $this->rules[] = new Rule(
        		'if_condition',
        		'if:(\w+)([!<>=]+)(\w+)',
        		'<?php if (isset($this->data[\'$1\'])){$base = $this->data[\'$1\'];}else{$base = \'$1\';};
        		if (isset($this->data[\'$3\'])){$value = $this->data[\'$3\'];}else{$value = \'$3\';}?>
        		<?php if ($base $2 $value): ?>'
        );
        $this->rules[] = new Rule(
            'ifnot', 
            'ifnot:(\w+)', 
            '<?php if (!isset($this->data[\'$1\']) || !$this->data[\'$1\']): ?>'
        );
        $this->rules[] = new Rule(
            'else', 
            'else', 
            '<?php else: ?>'
        );
        $this->rules[] = new Rule(
            'elseif_boolean', 
            'else:(\w+)', 
            '<?php elseif (isset($this->data[\'$1\']) && $this->data[\'$1\']): ?>'
        );
        $this->rules[] = new Rule(
            'elseif_condition', 
            'else:(\w+)([!<>=]+)(\w+)', 
            '<?php elseif (((isset($this->data[\'$1\']) && isset($this->data[\'$3\'])) && $this->data[\'$1\'] $2 $this->data[\'$3\']) ||
        		((isset($this->data[\'$1\']) && !isset($this->data[\'$3\'])) && $this->data[\'$1\'] $2 \'$3\') ||
        		((!isset($this->data[\'$1\']) && isset($this->data[\'$3\'])) && \'$1\' $2 $this->data[\'$3\']) ||
        		((!isset($this->data[\'$1\']) && !isset($this->data[\'$3\'])) && \'$1\' $2 \'$3\')): ?>'
        );
        $this->rules[] = new Rule(
            'endif', 
            'endif', 
            '<?php endif; ?>'
        );
        
        // Loops
        $this->rules[] = new Rule(
            'loop', 
            'loop:(\w+)', 
            '<?php foreach ($this->data[\'$1\'] as $element): $this->wrap($element); ?>'
        );
        $this->rules[] = new Rule(
            'endloop', 
            'endloop', 
            '<?php $this->unwrap(); endforeach; ?>'
        );
        
        // Importing
        $this->rules[] = new Rule(
            'import_view', 
            'import:(([^\/\s]+\/)?(.*))', 
            '<?php echo $this->importFile(\'$1\'); ?>'
        );
        
        // Clean variables
        $this->rules[] = new Rule(
            'escape_var', 
            'escape:(\w+)', 
            '<?php $this->showVariable(\'$1\', true); ?>'
        );
        
        // Custom rules
        $this->rules = array_merge($this->rules, $rules);
        
        // Variables
        $this->rules[] = new Rule(
            'variable', 
            '(\w+)', 
            '<?php $this->showVariable(\'$1\'); ?>'
        );
        
        // Arrays
        $this->rules[] = new Rule(
        		'variable_array',
        		'(\w+)\[(\w+)\]',
        		'<?php echo (isset($this->data[\'$1\'][\'$2\'])) ? $this->data[\'$1\'][\'$2\'] : "&#123;$1[$2]&#125"; ?>'
        );
        
        $this->rules[] = new Rule(
        		'variable_array_escape',
        		'escape:(\w+)\[(\w+)\]',
        		'<?php echo htmlentities($this->showVariable(\'$1\')[\'$2\']); ?>'
        );
        
        $this->data = $data;
        $this->stack = array();
        
        foreach ($this->rules as $rule) {
            $this->template = preg_replace('/\{' . $rule->rule() . '\}/', $rule->replacement(), $this->template);
        }
        
        $this->template = '?>' . $this->template;
        
        ob_start();
        eval($this->template);
        return ob_get_clean();
    }