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;
    }