/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Routing/Route
NameSizeModeActions
DashedRoute.php40470644editdlrm
EntityRoute.php27030644editdlrm
InflectedRoute.php35440644editdlrm
PluginShortRoute.php22770644editdlrm
RedirectRoute.php41170644editdlrm
Route.php304050644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Routing/Route/DashedRoute.php (4047B)
'MyPlugin', 'controller' => 'MyController', 'action' => 'myAction']` */ class DashedRoute extends Route { /** * Flag for tracking whether the defaults have been inflected. * * Default values need to be inflected so that they match the inflections that * match() will create. * * @var bool */ protected $_inflectedDefaults = false; /** * Camelizes the previously dashed plugin route taking into account plugin vendors * * @param string $plugin Plugin name * @return string */ protected function _camelizePlugin(string $plugin): string { $plugin = str_replace('-', '_', $plugin); if (strpos($plugin, '/') === false) { return Inflector::camelize($plugin); } [$vendor, $plugin] = explode('/', $plugin, 2); return Inflector::camelize($vendor) . '/' . Inflector::camelize($plugin); } /** * Parses a string URL into an array. If it matches, it will convert the * controller and plugin keys to their CamelCased form and action key to * camelBacked form. * * @param string $url The URL to parse * @param string $method The HTTP method. * @return array|null An array of request parameters, or null on failure. */ public function parse(string $url, string $method = ''): ?array { $params = parent::parse($url, $method); if (!$params) { return null; } if (!empty($params['controller'])) { $params['controller'] = Inflector::camelize($params['controller'], '-'); } if (!empty($params['plugin'])) { $params['plugin'] = $this->_camelizePlugin($params['plugin']); } if (!empty($params['action'])) { $params['action'] = Inflector::variable(str_replace( '-', '_', $params['action'] )); } return $params; } /** * Dasherizes the controller, action and plugin params before passing them on * to the parent class. * * @param array $url Array of parameters to convert to a string. * @param array $context An array of the current request context. * Contains information such as the current host, scheme, port, and base * directory. * @return string|null Either a string URL or null. */ public function match(array $url, array $context = []): ?string { $url = $this->_dasherize($url); if (!$this->_inflectedDefaults) { $this->_inflectedDefaults = true; $this->defaults = $this->_dasherize($this->defaults); } return parent::match($url, $context); } /** * Helper method for dasherizing keys in a URL array. * * @param array $url An array of URL keys. * @return array */ protected function _dasherize(array $url): array { foreach (['controller', 'plugin', 'action'] as $element) { if (!empty($url[$element])) { $url[$element] = Inflector::dasherize($url[$element]); } } return $url; } }