예제 #1
0
 /**
  * @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'));
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
파일: Tag.php 프로젝트: mattvb91/cphalcon
 public static function hasValue($name)
 {
     return parent::hasValue($name);
 }