original_string: protected function _getControllerActionConfiguration($actionName, $config)
      {
          $realAction = Hash::get($config, 'url.action', $actionName);
          if ($this->_crud()->isActionMapped($realAction)) {
              $action = $this->_action($realAction);
              $class = get_class($action);
              $class = substr($class, strrpos($class, '\\') + 1);
  
              if ($class === 'DeleteAction') {
                  $config += ['method' => 'DELETE'];
              }
  
              if (!isset($config['scope'])) {
                  $config['scope'] = $class === 'AddAction' ? 'table' : $action->scope();
              }
          }
  
          // apply defaults if necessary
          $scope = isset($config['scope']) ? $config['scope'] : 'entity';
          $method = isset($config['method']) ? $config['method'] : 'GET';
  
          $title = !empty($config['link_title']) ? $config['link_title'] : Inflector::humanize(Inflector::underscore($actionName));
          $url = ['action' => $realAction];
          if (isset($config['url'])) {
              $url = $config['url'] + $url;
          }
  
          $actionConfig = [
              'title' => $title,
              'url' => $url,
              'method' => $method,
              'options' => array_diff_key(
                  $config,
                  array_flip(['method', 'scope', 'link_title', 'url', 'scaffold', 'callback'])
              )
          ];
          if (!empty($config['callback'])) {
              $actionConfig['callback'] = $config['callback'];
          }
  
          return [$scope, $actionConfig];
      }
code: protected function _getControllerActionConfiguration($actionName, $config)
      {
          $realAction = Hash::get($config, 'url.action', $actionName);
          if ($this->_crud()->isActionMapped($realAction)) {
              $action = $this->_action($realAction);
              $class = get_class($action);
              $class = substr($class, strrpos($class, '\\') + 1);
  
              if ($class === 'DeleteAction') {
                  $config += ['method' => 'DELETE'];
              }
  
              if (!isset($config['scope'])) {
                  $config['scope'] = $class === 'AddAction' ? 'table' : $action->scope();
              }
          }
  
          // apply defaults if necessary
          $scope = isset($config['scope']) ? $config['scope'] : 'entity';
          $method = isset($config['method']) ? $config['method'] : 'GET';
  
          $title = !empty($config['link_title']) ? $config['link_title'] : Inflector::humanize(Inflector::underscore($actionName));
          $url = ['action' => $realAction];
          if (isset($config['url'])) {
              $url = $config['url'] + $url;
          }
  
          $actionConfig = [
              'title' => $title,
              'url' => $url,
              'method' => $method,
              'options' => array_diff_key(
                  $config,
                  array_flip(['method', 'scope', 'link_title', 'url', 'scaffold', 'callback'])
              )
          ];
          if (!empty($config['callback'])) {
              $actionConfig['callback'] = $config['callback'];
          }
  
          return [$scope, $actionConfig];
      }
code_tokens: protected function _getControllerActionConfiguration ( $ actionName , $ config ) { $ realAction = Hash :: get ( $ config , 'url.action' , $ actionName ) ; if ( $ this -> _crud ( ) -> isActionMapped ( $ realAction ) ) { $ action = $ this -> _action ( $ realAction ) ; $ class = get_class ( $ action ) ; $ class = substr ( $ class , strrpos ( $ class , '\\' ) + 1 ) ; if ( $ class === 'DeleteAction' ) { $ config += [ 'method' => 'DELETE' ] ; } if ( ! isset ( $ config [ 'scope' ] ) ) { $ config [ 'scope' ] = $ class === 'AddAction' ? 'table' : $ action -> scope ( ) ; } } // apply defaults if necessary $ scope = isset ( $ config [ 'scope' ] ) ? $ config [ 'scope' ] : 'entity' ; $ method = isset ( $ config [ 'method' ] ) ? $ config [ 'method' ] : 'GET' ; $ title = ! empty ( $ config [ 'link_title' ] ) ? $ config [ 'link_title' ] : Inflector :: humanize ( Inflector :: underscore ( $ actionName ) ) ; $ url = [ 'action' => $ realAction ] ; if ( isset ( $ config [ 'url' ] ) ) { $ url = $ config [ 'url' ] + $ url ; } $ actionConfig = [ 'title' => $ title , 'url' => $ url , 'method' => $ method , 'options' => array_diff_key ( $ config , array_flip ( [ 'method' , 'scope' , 'link_title' , 'url' , 'scaffold' , 'callback' ] ) ) ] ; if ( ! empty ( $ config [ 'callback' ] ) ) { $ actionConfig [ 'callback' ] = $ config [ 'callback' ] ; } return [ $ scope , $ actionConfig ] ; }
docstring: Returns url action configuration for a given action.
  
  This is used to figure out how a given action should be linked to.
  
  @param string $actionName Action name.
  @param array $config Config array.
  @return array
docstring_tokens: Returns url action configuration for a given action .