PHP 8.1.33
Preview: CFormModel.php Size: 2.12 KB
/home/jambtst2015/www/framework/web/CFormModel.php

<?php
/**
 * CFormModel class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

/**
 * CFormModel represents a data model that collects HTML form inputs.
 *
 * Unlike {@link 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
 * {@link rules()} to declare validation rules that should be applied to
 * the attributes.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package system.web
 * @since 1.0
 */
class CFormModel extends CModel
{
	private static $_names=array();

	/**
	 * Constructor.
	 * @param string $scenario name of the scenario that this model is used in.
	 * See {@link CModel::scenario} on how scenario is used by models.
	 * @see getScenario
	 */
	public function __construct($scenario='')
	{
		$this->setScenario($scenario);
		$this->init();
		$this->attachBehaviors($this->behaviors());
		$this->afterConstruct();
	}

	/**
	 * Initializes this model.
	 * This method is invoked in the constructor right after {@link scenario} is set.
	 * You may override this method to provide code that is needed to initialize the model (e.g. setting
	 * initial property values.)
	 */
	public function init()
	{
	}

	/**
	 * Returns the list of attribute names.
	 * By default, this method returns all public properties of the class.
	 * You may override this method to change the default.
	 * @return array list of attribute names. Defaults to all public properties of the class.
	 */
	public function attributeNames()
	{
		$className=get_class($this);
		if(!isset(self::$_names[$className]))
		{
			$class=new ReflectionClass(get_class($this));
			$names=array();
			foreach($class->getProperties() as $property)
			{
				$name=$property->getName();
				if($property->isPublic() && !$property->isStatic())
					$names[]=$name;
			}
			return self::$_names[$className]=$names;
		}
		else
			return self::$_names[$className];
	}
}

Directory Contents

Dirs: 9 × Files: 28

Name Size Perms Modified Actions
actions DIR
- drwxr-xr-x 2025-10-08 19:22:44
Edit Download
auth DIR
- drwxr-xr-x 2025-10-08 19:45:04
Edit Download
filters DIR
- drwxr-xr-x 2025-10-11 10:02:11
Edit Download
form DIR
- drwxr-xr-x 2025-10-09 05:45:59
Edit Download
helpers DIR
- drwxr-xr-x 2025-10-11 04:35:21
Edit Download
js DIR
- drwxr-xr-x 2025-10-15 09:54:12
Edit Download
renderers DIR
- drwxr-xr-x 2025-10-11 01:32:19
Edit Download
services DIR
- drwxr-xr-x 2025-10-12 12:01:04
Edit Download
widgets DIR
- drwxr-xr-x 2025-10-08 17:42:55
Edit Download
6.45 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
5.93 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
13.46 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
9.99 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
3.20 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
27.88 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
46.39 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
7.01 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
4.21 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
8.63 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
1.45 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
2.12 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
2.67 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
47.44 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
16.31 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
1.87 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
883 B lrw-r--r-- 2024-11-22 17:53:15
Edit Download
7.14 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
17.31 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
4.18 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
3.58 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
3.68 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
9.13 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
27.42 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
16.96 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
6.53 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
7.38 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
192.84 KB lrw-r--r-- 2025-11-04 15:12:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).