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

  • CBooleanValidator
  • CCaptchaValidator
  • CCompareValidator
  • CDateValidator
  • CDefaultValueValidator
  • CEmailValidator
  • CExistValidator
  • CFileValidator
  • CFilterValidator
  • CInlineValidator
  • CNumberValidator
  • CRangeValidator
  • CRegularExpressionValidator
  • CRequiredValidator
  • CSafeValidator
  • CStringValidator
  • CTypeValidator
  • CUniqueValidator
  • CUnsafeValidator
  • CUrlValidator
  • CValidator
  • X2UrlValidator
  • Overview
  • Package
  • Class
  • Tree

Class CUrlValidator

CUrlValidator validates that the attribute value is a valid http or https URL.

CComponent
Extended by CValidator
Extended by CUrlValidator

Direct known subclasses

X2UrlValidator
Package: system\validators
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/validators/CUrlValidator.php
Methods summary
protected
# validateAttribute( CModel $object, string $attribute )

Validates the attribute of the object. If there is any error, the error message is added to the object.

Validates the attribute of the object. If there is any error, the error message is added to the object.

Parameters

$object
CModel
$object the object being validated
$attribute
string
$attribute the attribute being validated
public mixed
# validateValue( string $value )

Validates a static value to see if it is a valid URL. Note that this method does not respect CUrlValidator::$allowEmpty property. This method is provided so that you can call it directly without going through the model validation rule mechanism.

Validates a static value to see if it is a valid URL. Note that this method does not respect CUrlValidator::$allowEmpty property. This method is provided so that you can call it directly without going through the model validation rule mechanism.

Parameters

$value
string
$value the value to be validated

Returns

mixed
false if the the value is not a valid URL, otherwise the possibly modified value (CUrlValidator::$defaultScheme)

Since

1.1.1
public string
# clientValidateAttribute( CModel $object, string $attribute )

Returns the JavaScript needed for performing client-side validation.

Returns the JavaScript needed for performing client-side validation.

Parameters

$object
CModel
$object the data object being validated
$attribute
string
$attribute the name of the attribute to be validated.

Returns

string
the client-side validation script.

Since

1.1.7

See

CActiveForm::$enableClientValidation

Overrides

CValidator::clientValidateAttribute()
Methods inherited from CValidator
addError(), applyTo(), createValidator(), isEmpty(), validate()
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 $pattern '/^{schemes}:\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)/i'
#

the regular expression used to validate the attribute value. Since version 1.1.7 the pattern may contain a {schemes} token that will be replaced by a regular expression which represents the CUrlValidator::$validSchemes.

the regular expression used to validate the attribute value. Since version 1.1.7 the pattern may contain a {schemes} token that will be replaced by a regular expression which represents the CUrlValidator::$validSchemes.

public array $validSchemes array('http','https')
#

list of URI schemes which should be considered valid. By default, http and https are considered to be valid schemes.

list of URI schemes which should be considered valid. By default, http and https are considered to be valid schemes.

Since

1.1.7
public string $defaultScheme
#

the default URI scheme. If the input doesn't contain the scheme part, the default scheme will be prepended to it (thus changing the input). Defaults to null, meaning a URL must contain the scheme part.

the default URI scheme. If the input doesn't contain the scheme part, the default scheme will be prepended to it (thus changing the input). Defaults to null, meaning a URL must contain the scheme part.

Since

1.1.7
public boolean $allowEmpty true
#

whether the attribute value can be null or empty. Defaults to true, meaning that if the attribute is empty, it is considered valid.

whether the attribute value can be null or empty. Defaults to true, meaning that if the attribute is empty, it is considered valid.

public boolean $validateIDN false
#

whether validation process should care about IDN (internationalized domain names). Default value is false which means that validation of URLs containing IDN will always fail.

whether validation process should care about IDN (internationalized domain names). Default value is false which means that validation of URLs containing IDN will always fail.

Since

1.1.13
Properties inherited from CValidator
$attributes, $builtInValidators, $enableClientValidation, $except, $message, $on, $safe, $skipOnError
API documentation generated by ApiGen 2.8.0