cakephp-2.0 > Router :: url()
A AbstractTransport AclBehavior AclComponent AclInterface AclNode AclShell Aco AcoAction ActionsAuthorize ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel AppShell Aro AuthComponent B BadRequestException BakeShell BakeTask BaseAuthenticate BaseAuthorize BasicAuthenticate BasicAuthentication BehaviorCollection C Cache CacheEngine CacheException CacheHelper CacheSession CakeEmail CakeErrorController CakeException CakeLog CakeLogException CakeLogInterface CakePlugin CakeRequest CakeResponse CakeRoute CakeSchema CakeSession CakeSessionException CakeSessionHandlerInterface CakeSocket ClassRegistry CommandListShell Component ComponentCollection ConfigReaderInterface Configure ConfigureException ConnectionManager ConsoleErrorHandler ConsoleException ConsoleInput ConsoleInputArgument ConsoleInputOption ConsoleInputSubcommand ConsoleOptionParser ConsoleOutput ConsoleShell ContainableBehavior Controller ControllerAuthorize ControllerTask CookieComponent CrudAuthorize D DatabaseSession DataSource DbAcl DbAclSchema DbConfigTask DboSource Debugger DebugTransport DigestAuthenticate DigestAuthentication Dispatcher E EmailComponent ErrorHandler ExceptionRenderer ExtractTask F File FileEngine FileLog FixtureTask Folder ForbiddenException FormAuthenticate FormHelper H Helper HelperCollection HelpFormatter HtmlHelper HttpException HttpResponse HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniReader InternalErrorException J JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MailTransport MediaView MemcacheEngine MethodNotAllowedException MissingActionException MissingBehaviorException MissingComponentException MissingConnectionException MissingControllerException MissingDatabaseException MissingDatasourceConfigException MissingDatasourceException MissingHelperException MissingLayoutException MissingModelException MissingPluginException MissingShellException MissingShellMethodException MissingTableException MissingTaskException MissingTestLoaderException MissingViewException Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte Mysql N NotFoundException NumberHelper O Object ObjectCollection P PagesController PagesController PaginatorComponent PaginatorHelper Permission PhpReader PluginShortRoute PluginTask Postgres PrivateActionException ProjectTask PrototypeEngineHelper R RedirectRoute RequestHandlerComponent Router RouterException RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher SmtpTransport SocketException Sqlite Sqlserver String T TaskCollection TemplateTask TestsuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior U UnauthorizedException UpgradeShell V Validation View ViewTask W WincacheEngine X XcacheEngine Xml XmlException

url

line:690 at /lib/Cake/Routing/Router.php
Finds URL for specified action.

Method

(string) public url ($url = null, $full = false)

Parameters

ParameterTypeCommentDefault
$url mixed optional Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" or an array specifying any of the following: 'controller', 'action', and/or 'plugin', in addition to named arguments (keyed array elements), and standard URL arguments (indexed array elements) null
$full mixed optional If (bool) true, the full base URL will be prepended to the result. If an array accepts the following keys - escape - used when making urls embedded in html escapes query string '&' - full - if true the full base URL will be prepended. false

Return

string

Comment

Finds URL for specified action.

Returns an URL pointing to a combination of controller and action. Param
$url can be:

- Empty - the method will find address to actual controller/action.
- '/' - the method will find base URL of application.
- A combination of controller/action - the method will find url for it.

There are a few 'special' parameters that can change the final URL string that is generated

- `base` - Set to false to remove the base path from the generated url. If your application
is not in the root directory, this can be used to generate urls that are 'cake relative'.
cake relative urls are required when using requestAction.
- `?` - Takes an array of query string parameters
- `#` - Allows you to set url hash fragments.
- `full_base` - If true the `FULL_BASE_URL` constant will be prepended to generated urls.

@param mixed $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4"
or an array specifying any of the following: 'controller', 'action',
and/or 'plugin', in addition to named arguments (keyed array elements),
and standard URL arguments (indexed array elements)
@param mixed $full If (bool) true, the full base URL will be prepended to the result.
If an array accepts the following keys
- escape - used when making urls embedded in html escapes query string '&'
- full - if true the full base URL will be prepended.
@return string Full translated URL with base path.