*/ abstract class Behavior { // Behavioral parameters And the same configuration parameter settings protected $options = array(); /** * Architecture function * @access public */ public function __construct() { if(!empty($this->options)) { foreach ($this->options as $name=>$val){ if(NULL !== C($name)) { // Parameters have been set Behavioral parameters overwritten $this->options[$name] = C($name); }else{ // Parameter is not set The default value is passed to the configuration C($name,$val); } } array_change_key_case($this->options); } } // Get behavioral parameters public function __get($name){ return $this->options[strtolower($name)]; } /** * Execution behavior run method is unique interface Behavior * @access public * @param mixed $params Behavioral parameters * @return void */ abstract public function run(&$params); }