Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ea4cd9c5
Commit
ea4cd9c5
authored
Jul 22, 2011
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
w
parent
c80c9dec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
20 deletions
+21
-20
YiiBase.php
framework/YiiBase.php
+1
-1
Component.php
framework/base/Component.php
+12
-11
Dictionary.php
framework/base/Dictionary.php
+1
-1
Model.php
framework/base/Model.php
+6
-6
Vector.php
framework/base/Vector.php
+1
-1
No files found.
framework/YiiBase.php
View file @
ea4cd9c5
...
...
@@ -304,7 +304,7 @@ class YiiBase
* Any additional parameters passed to this method will be
* passed to the constructor of the object being created.
*
* ~~~
php
* ~~~
* $component = Yii::createComponent('@app/components/GoogleMap');
* $component = Yii::createComponent('\application\components\GoogleMap');
* $component = Yii::createComponent(array(
...
...
framework/base/Component.php
View file @
ea4cd9c5
...
...
@@ -18,7 +18,7 @@ namespace yii\base;
* and/or a setter method (e.g. `setLabel`). For example, the following
* getter and setter methods define a property named `label`:
*
* ~~~
php
* ~~~
* private $_label;
*
* public function getLabel()
...
...
@@ -36,7 +36,7 @@ namespace yii\base;
* Reading or writing a property will cause the invocation of the corresponding
* getter or setter method. For example,
*
* ~~~
php
* ~~~
* // equivalent to $label = $component->getLabel();
* $label = $component->label;
* // equivalent to $component->setLabel('abc');
...
...
@@ -49,7 +49,7 @@ namespace yii\base;
* (called *event handlers*) attached to the event will be invoked automatically.
* The `on` method is typically declared like the following:
*
* ~~~
php
* ~~~
* public function onClick($event)
* {
* $this->raiseEvent('onClick', $event);
...
...
@@ -63,7 +63,7 @@ namespace yii\base;
*
* An event handler should be defined with the following signature:
*
* ~~~
php
* ~~~
* public function foo($event) { ... }
* ~~~
*
...
...
@@ -72,14 +72,14 @@ namespace yii\base;
* To attach an event handler to an event, call [[attachEventHandler]].
* Alternatively, you can also do the following:
*
* ~~~
php
* ~~~
* $component->onClick = $callback;
* // or $component->onClick->add($callback);
* ~~~
*
* where `$callback` refers to a valid PHP callback. Some examples of `$callback` are:
*
* ~~~
php
* ~~~
* 'handleOnClick' // handleOnClick() is a global function
* array($object, 'handleOnClick') // $object->handleOnClick()
* array('Page', 'handleOnClick') // Page::handleOnClick()
...
...
@@ -375,9 +375,10 @@ class Component
* You may manipulate the returned [[Vector]] object by adding or removing handlers.
* For example,
*
* ~~~
php
* ~~~
* $component->getEventHandlers($eventName)->insertAt(0, $eventHandler);
* ~~~
*
* @param string $name the event name
* @return Vector list of attached event handlers for the event
* @throws Exception if the event is not defined
...
...
@@ -399,14 +400,14 @@ class Component
*
* This is equivalent to the following code:
*
* ~~~
php
* ~~~
* $component->getEventHandlers($eventName)->add($eventHandler);
* ~~~
*
* An event handler must be a valid PHP callback. The followings are
* some examples:
*
* ~~~
php
* ~~~
* 'handleOnClick' // handleOnClick() is a global function
* array($object, 'handleOnClick') // $object->handleOnClick()
* array('Page', 'handleOnClick') // Page::handleOnClick()
...
...
@@ -415,7 +416,7 @@ class Component
*
* An event handler must be defined with the following signature,
*
* ~~~
php
* ~~~
* function handlerName($event) {}
* ~~~
*
...
...
@@ -624,7 +625,7 @@ class Component
*
* If a PHP callback is used, the corresponding function/method signature should be
*
* ~~~
php
* ~~~
* function foo($param1, $param2, ..., $component) { ... }
* ~~~
*
...
...
framework/base/Dictionary.php
View file @
ea4cd9c5
...
...
@@ -20,7 +20,7 @@ namespace yii\base;
* Because Dictionary implements a set of SPL interfaces, it can be used
* like a regular PHP array as follows,
*
* ~~~
php
* ~~~
* $dictionary[$key] = $value; // add a key-value pair
* unset($dictionary[$key]); // remove the value with the specified key
* if (isset($dictionary[$key])) // if the dictionary contains the key
...
...
framework/base/Model.php
View file @
ea4cd9c5
...
...
@@ -78,7 +78,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
*
* Each rule is an array with the following structure:
*
* ~~~
php
* ~~~
* array(
* 'attribute list',
* 'validator type',
...
...
@@ -100,7 +100,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
* A validator can be either a model class method or an object.
* If the former, the method must have the following signature:
*
* ~~~
php
* ~~~
* // $params refers to validation parameters given in the rule
* function validatorName($attribute, $params)
* ~~~
...
...
@@ -111,7 +111,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
*
* The following are some examples:
*
* ~~~
php
* ~~~
* array(
* array('username', 'required'),
* array('username', 'length', 'min'=>3, 'max'=>12),
...
...
@@ -136,7 +136,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
* behavior names. Each behavior configuration can be either a string specifying
* the behavior class or an array of the following structure:
*
* ~~~
php
* ~~~
* 'behaviorName' => array(
* 'class' => 'BehaviorClass',
* 'property1' => 'value1',
...
...
@@ -295,7 +295,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
* manipulate it by inserting or removing validators (useful in model behaviors).
* For example,
*
* ~~~
php
* ~~~
* $model->validators->add($newValidator);
* ~~~
*
...
...
@@ -412,7 +412,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
* @return array errors for all attributes or the specified attribute. Empty array is returned if no error.
* Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:
*
* ~~~
php
* ~~~
* array(
* 'username' => array(
* 'Username is required.',
...
...
framework/base/Vector.php
View file @
ea4cd9c5
...
...
@@ -21,7 +21,7 @@ namespace yii\base;
* Because Vector implements a set of SPL interfaces, it can be used
* like a regular PHP array as follows,
*
* ~~~
php
* ~~~
* $vector[] = $item; // append new item at the end
* $vector[$index] = $item; // set new item at $index
* unset($vector[$index]); // remove the item at $index
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment