original_string: public function secure(array $fields = [], array $secureAttributes = [])
      {
          if (!$this->_View->getRequest()->getParam('_Token')) {
              return '';
          }
          $debugSecurity = Configure::read('debug');
          if (isset($secureAttributes['debugSecurity'])) {
              $debugSecurity = $debugSecurity && $secureAttributes['debugSecurity'];
              unset($secureAttributes['debugSecurity']);
          }
          $secureAttributes['secure'] = static::SECURE_SKIP;
          $secureAttributes['autocomplete'] = 'off';
  
          $tokenData = $this->_buildFieldToken(
              $this->_lastAction,
              $fields,
              $this->_unlockedFields
          );
          $tokenFields = array_merge($secureAttributes, [
              'value' => $tokenData['fields'],
          ]);
          $out = $this->hidden('_Token.fields', $tokenFields);
          $tokenUnlocked = array_merge($secureAttributes, [
              'value' => $tokenData['unlocked'],
          ]);
          $out .= $this->hidden('_Token.unlocked', $tokenUnlocked);
          if ($debugSecurity) {
              $tokenDebug = array_merge($secureAttributes, [
                  'value' => urlencode(json_encode([
                      $this->_lastAction,
                      $fields,
                      $this->_unlockedFields
                  ])),
              ]);
              $out .= $this->hidden('_Token.debug', $tokenDebug);
          }
  
          return $this->formatTemplate('hiddenBlock', ['content' => $out]);
      }
code: public function secure(array $fields = [], array $secureAttributes = [])
      {
          if (!$this->_View->getRequest()->getParam('_Token')) {
              return '';
          }
          $debugSecurity = Configure::read('debug');
          if (isset($secureAttributes['debugSecurity'])) {
              $debugSecurity = $debugSecurity && $secureAttributes['debugSecurity'];
              unset($secureAttributes['debugSecurity']);
          }
          $secureAttributes['secure'] = static::SECURE_SKIP;
          $secureAttributes['autocomplete'] = 'off';
  
          $tokenData = $this->_buildFieldToken(
              $this->_lastAction,
              $fields,
              $this->_unlockedFields
          );
          $tokenFields = array_merge($secureAttributes, [
              'value' => $tokenData['fields'],
          ]);
          $out = $this->hidden('_Token.fields', $tokenFields);
          $tokenUnlocked = array_merge($secureAttributes, [
              'value' => $tokenData['unlocked'],
          ]);
          $out .= $this->hidden('_Token.unlocked', $tokenUnlocked);
          if ($debugSecurity) {
              $tokenDebug = array_merge($secureAttributes, [
                  'value' => urlencode(json_encode([
                      $this->_lastAction,
                      $fields,
                      $this->_unlockedFields
                  ])),
              ]);
              $out .= $this->hidden('_Token.debug', $tokenDebug);
          }
  
          return $this->formatTemplate('hiddenBlock', ['content' => $out]);
      }
code_tokens: public function secure ( array $ fields = [ ] , array $ secureAttributes = [ ] ) { if ( ! $ this -> _View -> getRequest ( ) -> getParam ( '_Token' ) ) { return '' ; } $ debugSecurity = Configure :: read ( 'debug' ) ; if ( isset ( $ secureAttributes [ 'debugSecurity' ] ) ) { $ debugSecurity = $ debugSecurity && $ secureAttributes [ 'debugSecurity' ] ; unset ( $ secureAttributes [ 'debugSecurity' ] ) ; } $ secureAttributes [ 'secure' ] = static :: SECURE_SKIP ; $ secureAttributes [ 'autocomplete' ] = 'off' ; $ tokenData = $ this -> _buildFieldToken ( $ this -> _lastAction , $ fields , $ this -> _unlockedFields ) ; $ tokenFields = array_merge ( $ secureAttributes , [ 'value' => $ tokenData [ 'fields' ] , ] ) ; $ out = $ this -> hidden ( '_Token.fields' , $ tokenFields ) ; $ tokenUnlocked = array_merge ( $ secureAttributes , [ 'value' => $ tokenData [ 'unlocked' ] , ] ) ; $ out .= $ this -> hidden ( '_Token.unlocked' , $ tokenUnlocked ) ; if ( $ debugSecurity ) { $ tokenDebug = array_merge ( $ secureAttributes , [ 'value' => urlencode ( json_encode ( [ $ this -> _lastAction , $ fields , $ this -> _unlockedFields ] ) ) , ] ) ; $ out .= $ this -> hidden ( '_Token.debug' , $ tokenDebug ) ; } return $ this -> formatTemplate ( 'hiddenBlock' , [ 'content' => $ out ] ) ; }
docstring: Generates a hidden field with a security hash based on the fields used in
  the form.
  
  If $secureAttributes is set, these HTML attributes will be merged into
  the hidden input tags generated for the Security Component. This is
  especially useful to set HTML5 attributes like 'form'.
  
  @param array $fields If set specifies the list of fields to use when
  generating the hash, else $this->fields is being used.
  @param array $secureAttributes will be passed as HTML attributes into the hidden
  input elements generated for the Security Component.
  @return string A hidden input field with a security hash, or empty string when
  secured forms are not in use.
docstring_tokens: Generates a hidden field with a security hash based on the fields used in the form .