HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
TbBaseInputWidget.php
Go to the documentation of this file.
1 <?php
15 class TbBaseInputWidget extends CInputWidget {
16 
17  public function init() {
18 
19  $this->setDefaultPlaceholder();
20 
21  if(!isset($this->htmlOptions['class']) || empty($this->htmlOptions['class']))
22  $this->htmlOptions['class'] = 'ct-form-control';
23  else
24  $this->htmlOptions['class'] .= ' ct-form-control';
25  }
26 
27  protected function setDefaultPlaceholder() {
28 
29  if (!$this->model)
30  return;
31 
32  if (!isset($this->htmlOptions['placeholder'])) {
33  $this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute);
34  }
35 
36  }
37 }