code/libraries/joomlatools/library/template/filter/form.php
protected function _addToken(&$text)
    {
        if (!empty($this->_token_value))
        {
            // POST: Add token
            $text    = preg_replace('#(<\s*form[^>]+method="post"[^>]*>)#si',
                '\1'.PHP_EOL.'<input type="hidden" name="'.$this->_token_name.'" value="'.$this->_token_value.'" />',
                $text
            );

            // GET: Add token to .k-js-grid-controller forms
            $text    = preg_replace('#(<\s*form[^>]+class=(?:\'|")[^\'"]*?k-js-grid-controller.*?(?:\'|")[^>]*)>#si',
                '\1 data-token-name="'.$this->_token_name.'" data-token-value="'.$this->_token_value.'">',
                $text
            );
        }

        return $this;
    }
protected function _addToken(&$text)
    {
        if (!empty($this->_token_value))
        {
            // POST: Add token
            $text    = preg_replace('#(<\s*form[^>]+method="post"[^>]*>)#si',
                '\1'.PHP_EOL.'<input type="hidden" name="'.$this->_token_name.'" value="'.$this->_token_value.'" />',
                $text
            );

            // GET: Add token to .k-js-grid-controller forms
            $text    = preg_replace('#(<\s*form[^>]+class=(?:\'|")[^\'"]*?k-js-grid-controller.*?(?:\'|")[^>]*)>#si',
                '\1 data-token-name="'.$this->_token_name.'" data-token-value="'.$this->_token_value.'">',
                $text
            );
        }

        return $this;
    }
protected function _addToken ( & $ text ) { if ( ! empty ( $ this -> _token_value ) ) { // POST: Add token $ text = preg_replace ( '#(<\s*form[^>]+method="post"[^>]*>)#si' , '\1' . PHP_EOL . '<input type="hidden" name="' . $ this -> _token_name . '" value="' . $ this -> _token_value . '" />' , $ text ) ; // GET: Add token to .k-js-grid-controller forms $ text = preg_replace ( '#(<\s*form[^>]+class=(?:\'|")[^\'"]*?k-js-grid-controller.*?(?:\'|")[^>]*)>#si' , '\1 data-token-name="' . $ this -> _token_name . '" data-token-value="' . $ this -> _token_value . '">' , $ text ) ; } return $ this ; }
Add the token to the form

@param string $text Template text
@return $this
Add the token to the form