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
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • ActionFormModelBase
  • CalendarEventFormModel
  • CallFormModel
  • CreatePageFormModel
  • EditMobileFormsFormModel
  • EventCommentPublisherFormModel
  • EventFormModel
  • EventPublisherFormModel
  • FileSystemObjectDataProvider
  • MassActionFormModel
  • MobilePagination
  • NoteFormModel
  • NotificationsController
  • TimeFormModel
  • UploadLogoFormModel
  • X2FormModel
  • X2HttpRequest
  • Overview
  • Package
  • Class
  • Tree

Class X2FormModel

CFormModel represents a data model that collects HTML form inputs.

Unlike CActiveRecord, the data collected by CFormModel are stored in memory only, instead of database.

To collect user inputs, you may extend CFormModel and define the attributes whose values are to be collected from user inputs. You may override CModel::rules() to declare validation rules that should be applied to the attributes.

CComponent
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CFormModel
Extended by X2FormModel

Direct known subclasses

ActionFormModelBase, CreatePageFormModel, EditMobileFormsFormModel, GlobalCSSFormModel, GlobalImportFormModel, LoginForm, UploadLogoFormModel

Indirect known subclasses

ActionFormModel, CalendarEventFormModel, CallFormModel, EventFormModel, NoteFormModel, TimeFormModel
Package: system\web
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/components/X2FormModel.php
Methods summary
public boolean
# validate( array $attributes = null, boolean $clearErrors = true )

Performs the validation.

Performs the validation.

This method executes the validation rules as declared in CModel::rules(). Only the rules applicable to the current scenario will be executed. A rule is considered applicable to a scenario if its 'on' option is not set or contains the scenario.

Errors found during the validation can be retrieved via CModel::getErrors().

Parameters

$attributes
array
$attributes list of attributes that should be validated. Defaults to null, meaning any attribute listed in the applicable validation rules should be validated. If this parameter is given as a list of attributes, only the listed attributes will be validated.
$clearErrors
boolean
$clearErrors whether to call CModel::clearErrors() before performing validation

Returns

boolean
whether the validation is successful without any error.

See

CModel::beforeValidate()
CModel::afterValidate()

Overrides

CModel::validate()
public
# getAllErrorMessages( )
Methods inherited from CFormModel
__construct(), attributeNames(), init()
Methods inherited from CModel
addError(), addErrors(), afterConstruct(), afterValidate(), attributeLabels(), beforeValidate(), behaviors(), clearErrors(), createValidators(), generateAttributeLabel(), getAttributeLabel(), getAttributes(), getError(), getErrors(), getIterator(), getSafeAttributeNames(), getScenario(), getValidatorList(), getValidators(), hasErrors(), isAttributeRequired(), isAttributeSafe(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), onAfterConstruct(), onAfterValidate(), onBeforeValidate(), onUnsafeAttribute(), rules(), setAttributes(), setScenario(), unsetAttributes()
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 boolean $throwExceptions false
#

if true, instead of adding error messages to the model, exceptions will be thrown
with error message

if true, instead of adding error messages to the model, exceptions will be thrown with error message

public CException $exceptionClass 'CHttpException'
#

type of exception that will get thrown if $throwExceptions is true

type of exception that will get thrown if $throwExceptions is true

Magic properties inherited from CModel
$attributes, $errors, $iterator, $safeAttributeNames, $scenario, $validatorList, $validators
X2CRM Documentation API documentation generated by ApiGen 2.8.0