cakephp-1.3 > Router :: url()
A AclBase AclBehavior AclComponent AclNode AclShell Aco AcoAction AjaxHelper ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel Aro AuthComponent B BakeShell BakeTask BehaviorCollection C Cache CacheEngine CacheHelper CakeErrorController CakeLog CakeRoute CakeSchema CakeSession CakeSocket ClassRegistry Component Configure ConnectionManager ConsoleShell ContainableBehavior Controller ControllerTask CookieComponent D DataSource DbAcl DbAclSchema DbConfigTask DboMssql DboMysql DboMysqlBase DboMysqli DboOracle DboPostgres DboSource DboSqlite Debugger Dispatcher E EmailComponent ErrorHandler ErrorHandler ExtractTask F File FileEngine FileLog FixtureTask Folder FormHelper H Helper HtmlHelper HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniAcl J JavascriptHelper JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MagicDb MagicFileResource MediaView MemcacheEngine Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte N NumberHelper O Object Overloadable Overloadable Overloadable2 Overloadable2 P PagesController PagesController PaginatorHelper Permission PluginShortRoute PluginTask ProjectTask PrototypeEngineHelper R RequestHandlerComponent Router RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher String T TemplateTask TestSuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior V Validation View ViewTask X XcacheEngine Xml XmlElement XmlHelper XmlManager XmlNode XmlTextNode

url

line:764 at /cake/libs/router.php
Finds URL for specified action.

Method

(string) 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.
@access public
@static