Current Path : /data/web/virtuals/51568/virtual/www/subdom/srps/src/form/ |
Current File : /data/web/virtuals/51568/virtual/www/subdom/srps/src/form/HiddenField.php |
<?php namespace app\form; use app\Model; class HiddenField { public $model; public $attribute; public function __construct(Model $model, string $attribute) { $this->model = $model; $this->attribute = $attribute; } public function __toString() { return sprintf(' <div id="field-%s" class="form-group"> <input type="hidden" id="%s" name="%s" value="%s" class="form-control"> </div>', $this->attribute, $this->attribute, $this->attribute, $this->model->{$this->attribute} ); } }