/** * @see 2402 issue * @link https://github.com/phalcon/cphalcon/issues/2402 * @throws Exception */ public function testDisplayValues() { Tag::setDefault('property1', 'testVal1'); Tag::setDefault('property2', 'testVal2'); Tag::setDefault('property3', 'testVal3'); $this->assertTrue(Tag::hasValue('property1')); $this->assertTrue(Tag::hasValue('property2')); $this->assertTrue(Tag::hasValue('property3')); $this->assertEquals('testVal1', Tag::getValue('property1')); $this->assertEquals('testVal2', Tag::getValue('property2')); $this->assertEquals('testVal3', Tag::getValue('property3')); }
/** * Returns the element's value * * @return mixed */ public function getValue() { $value = null; //Get the related form if (is_object($this->_form) === true) { $hasDefaultValue = Tag::hasValue($this->_name); if ($hasDefaultValue === false) { //Get the possible value for the widget $value = $this->_form->getValue($this->_name); } } //Assign the default value if there is no form available if (is_null($value) === true) { $value = $this->_value; } return $value; }
public static function hasValue($name) { return parent::hasValue($name); }