Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionFormModelBase
  • CActiveDataProvider
  • CalendarEventFormModel
  • CallFormModel
  • CArrayDataProvider
  • CAssetManager
  • CBaseController
  • CBaseUrlRule
  • CCacheHttpSession
  • CClientScript
  • CController
  • CCookieCollection
  • CDataProvider
  • CDataProviderIterator
  • CDbHttpSession
  • CExtController
  • CFormModel
  • CHttpCookie
  • CHttpRequest
  • CHttpSession
  • CHttpSessionIterator
  • COutputEvent
  • CPagination
  • CreatePageFormModel
  • CSort
  • CSqlDataProvider
  • CTheme
  • CThemeManager
  • CUploadedFile
  • CUrlManager
  • CUrlRule
  • CWebApplication
  • CWebModule
  • CWidgetFactory
  • EditMobileFormsFormModel
  • EventCommentPublisherFormModel
  • EventFormModel
  • EventPublisherFormModel
  • FileSystemObjectDataProvider
  • MassActionFormModel
  • MobilePagination
  • NoteFormModel
  • NotificationsController
  • TimeFormModel
  • UploadLogoFormModel
  • X2FormModel
  • X2HttpRequest

Interfaces

  • IDataProvider
  • IWidgetFactory
  • Overview
  • Package
  • Class
  • Tree

Class CUrlRule

CUrlRule represents a URL formatting/parsing rule.

It mainly consists of two parts: route and pattern. The former classifies the rule so that it only applies to specific controller-action route. The latter performs the actual formatting and parsing role. The pattern may have a set of named parameters.

CComponent
Extended by CBaseUrlRule
Extended by CUrlRule

Direct known subclasses

X2UrlRule
Package: system\web
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/CUrlManager.php
Methods summary
public
# __construct( string $route, string $pattern )

Constructor.

Constructor.

Parameters

$route
string
$route the route of the URL (controller/action)
$pattern
string
$pattern the pattern for matching the URL
public mixed
# createUrl( CUrlManager $manager, string $route, array $params, string $ampersand )

Creates a URL based on this rule.

Creates a URL based on this rule.

Parameters

$manager
CUrlManager
$manager the manager
$route
string
$route the route
$params
array
$params list of parameters
$ampersand
string
$ampersand the token separating name-value pairs in the URL.

Returns

mixed
the constructed URL or false on error
public mixed
# parseUrl( CUrlManager $manager, CHttpRequest $request, string $pathInfo, string $rawPathInfo )

Parses a URL based on this rule.

Parses a URL based on this rule.

Parameters

$manager
CUrlManager
$manager the URL manager
$request
CHttpRequest
$request the request object
$pathInfo
string
$pathInfo path info part of the URL
$rawPathInfo
string
$rawPathInfo path info that contains the potential URL suffix

Returns

mixed
the route that consists of the controller ID and action ID or false on error
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public string $urlSuffix
#

the URL suffix used for this rule. For example, ".html" can be used so that the URL looks like pointing to a static HTML page. Defaults to null, meaning using the value of CUrlManager::$urlSuffix.

the URL suffix used for this rule. For example, ".html" can be used so that the URL looks like pointing to a static HTML page. Defaults to null, meaning using the value of CUrlManager::$urlSuffix.

public boolean $caseSensitive
#

whether the rule is case sensitive. Defaults to null, meaning using the value of CUrlManager::$caseSensitive.

whether the rule is case sensitive. Defaults to null, meaning using the value of CUrlManager::$caseSensitive.

public array $defaultParams array()
#

the default GET parameters (name=>value) that this rule provides. When this rule is used to parse the incoming request, the values declared in this property will be injected into $_GET.

the default GET parameters (name=>value) that this rule provides. When this rule is used to parse the incoming request, the values declared in this property will be injected into $_GET.

public boolean $matchValue
#

whether the GET parameter values should match the corresponding sub-patterns in the rule when creating a URL. Defaults to null, meaning using the value of CUrlManager::$matchValue. When this property is false, it means a rule will be used for creating a URL if its route and parameter names match the given ones. If this property is set true, then the given parameter values must also match the corresponding parameter sub-patterns. Note that setting this property to true will degrade performance.

whether the GET parameter values should match the corresponding sub-patterns in the rule when creating a URL. Defaults to null, meaning using the value of CUrlManager::$matchValue. When this property is false, it means a rule will be used for creating a URL if its route and parameter names match the given ones. If this property is set true, then the given parameter values must also match the corresponding parameter sub-patterns. Note that setting this property to true will degrade performance.

Since

1.1.0
public string $verb
#

the HTTP verb (e.g. GET, POST, DELETE) that this rule should match. If this rule can match multiple verbs, please separate them with commas. If this property is not set, the rule can match any verb. Note that this property is only used when parsing a request. It is ignored for URL creation.

the HTTP verb (e.g. GET, POST, DELETE) that this rule should match. If this rule can match multiple verbs, please separate them with commas. If this property is not set, the rule can match any verb. Note that this property is only used when parsing a request. It is ignored for URL creation.

Since

1.1.7
public boolean $parsingOnly false
#

whether this rule is only used for request parsing. Defaults to false, meaning the rule is used for both URL parsing and creation.

whether this rule is only used for request parsing. Defaults to false, meaning the rule is used for both URL parsing and creation.

Since

1.1.7
public string $route
#

the controller/action pair

the controller/action pair

public array $references array()
#

the mapping from route param name to token name (e.g. _r1=><1>)

the mapping from route param name to token name (e.g. _r1=><1>)

public string $routePattern
#

the pattern used to match route

the pattern used to match route

public string $pattern
#

regular expression used to parse a URL

regular expression used to parse a URL

public string $template
#

template used to construct a URL

template used to construct a URL

public array $params array()
#

list of parameters (name=>regular expression)

list of parameters (name=>regular expression)

public boolean $append
#

whether the URL allows additional parameters at the end of the path info.

whether the URL allows additional parameters at the end of the path info.

public boolean $hasHostInfo
#

whether host info should be considered for this rule

whether host info should be considered for this rule

API documentation generated by ApiGen 2.8.0