예제 #1
0
	/**
	 * Add an array of controls at once, useful in conjunction with the model->getControlLinks method.
	 *
	 * If a Model is provided as the subject, that is used as the subject and all system hooks apply thereof.
	 *
	 * @param array|Model $controls
	 */
	public function addControls($controls){
		if($controls instanceof Model){
			// Allow a raw Model to be sent in as the control subject.
			// This is a shortcut for Controllers much like the {controls} smarty function has.
			$this->controls = ViewControls::DispatchModel($controls);
			$this->controls->setProxyText('Widget Controls');
			return;
		}

		foreach($controls as $c){
			$this->addControl($c);
		}
	}