FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Check.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class Check extends \Rsi\Fred\Controller\View\Html\Widget{
6 
7  public function renderCaption(){
8  return null;
9  }
10 
11  protected function renderCheckbox($value,$attribs = null){
12  return $this->html->label(
13  $this->html->input(
14  '1',
15  array_merge($this->attribs(),$attribs ?: [],['checked' => $this->_widget->format($value)]),
16  'checkbox',
17  $this->_name
18  ) .
19  ($this->_widget->parent ? null : $this->_widget->caption($this->_id))
20  );
21  }
22 
23  protected function renderMinimal($value,$raw){
24  return $this->renderReadable($value,$raw);
25  }
26 
27  protected function renderReadable($value,$raw){
28  return $this->container($this->renderCheckbox($value,['disabled' => true]),'readable');
29  }
30 
31  protected function renderWriteable($value,$raw){
32  return $this->container($this->renderCheckbox($value),'writeable');
33  }
34 
35 }
renderCheckbox($value, $attribs=null)
Definition: Check.php:11
container($content, $display)
Definition: Widget.php:42