Example #1
0
 /**
  * Date Field
  *
  * Renders a date field for a model attribute (automatically converting timestamps into RFC3339 date format).
  * This method is a wrapper of `CHtml::activeDateField` which you should check for detailed information about
  * the parameters for this method.
  *
  * @access public
  * @param CModel $model
  * @param string $attribute
  * @param array $htmlOptions
  * @return string
  */
 public function dateField($model, $attribute, $htmlOptions = array())
 {
     $this->convertTimestamp($model, $attribute);
     return parent::dateField($model, $attribute, $htmlOptions);
 }
Example #2
0
 /**
  * @inheritDoc
  */
 public function dateField($model, $attribute, $htmlOptions = array())
 {
     if (!$this->qualifyNames && !isset($htmlOptions['name'])) {
         $htmlOptions['name'] = $attribute;
     }
     if (!isset($htmlOptions['itemprop'])) {
         $htmlOptions['itemprop'] = $this->getItemPropName($attribute);
     }
     if (!isset($htmlOptions['value']) && $model->{$attribute} instanceof \DateTime) {
         $htmlOptions['value'] = $model->{$attribute}->format('Y-m-d');
     }
     return parent::dateField($model, $attribute, $htmlOptions);
 }
Example #3
0
 public function dateField($model, $attribute, $htmlOptions = array())
 {
     return $this->label($model, $attribute) . parent::dateField($model, $attribute, $htmlOptions);
 }