lithium\console\command\Create::_namespace PHP Method

_namespace() protected method

Get the namespace.
protected _namespace ( string $request, array $options = [] ) : string
$request string
$options array
return string
    protected function _namespace($request, $options = array())
    {
        $name = $request->command;
        $defaults = array('prefix' => $this->_library['prefix'], 'prepend' => null, 'spaces' => array('model' => 'models', 'view' => 'views', 'controller' => 'controllers', 'command' => 'extensions.command', 'adapter' => 'extensions.adapter', 'helper' => 'extensions.helper'));
        $options += $defaults;
        if (isset($options['spaces'][$name])) {
            $name = $options['spaces'][$name];
        }
        return str_replace('.', '\\', $options['prefix'] . $options['prepend'] . $name);
    }

Usage Example

Example #1
0
 /**
  * Get the namespace for the migration.
  *
  * @param string $request
  * @param array|string $options
  * @return string
  */
 protected function _namespace($request, $options = array())
 {
     return parent::_namespace($request, array('prepend' => 'resources.'));
 }
All Usage Examples Of lithium\console\command\Create::_namespace