Ouzo\Routing\RouteRule::getName PHP Method

getName() public method

public getName ( )
    public function getName()
    {
        $name = Arrays::getValue($this->options, 'as', $this->prepareRuleName());
        $nameWithPath = Strings::appendSuffix($name, '_path');
        $name = lcfirst(Strings::underscoreToCamelCase($nameWithPath));
        return $this->actionRequired ? $name : '';
    }

Usage Example

Exemplo n.º 1
0
    private function _createFunction(RouteRule $routeRule)
    {
        $name = $routeRule->getName();
        $uri = $routeRule->getUri();
        $parameters = $this->_prepareParameters($uri);
        $uriWithVariables = str_replace(':', '$', $uri);
        $parametersString = implode(', ', $parameters);
        $checkParametersStatement = $this->_createCheckParameters($parameters);
        $function = <<<FUNCTION
function {$name}({$parametersString})
{
{$checkParametersStatement}return url("{$uriWithVariables}");
}


FUNCTION;
        return $name ? $function : '';
    }
All Usage Examples Of Ouzo\Routing\RouteRule::getName