FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Lookup.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class Lookup extends Char{
6 
7  protected $_listId = null;
8 
9  protected function attribs(){
10  return parent::attribs() + ['list' => $this->listId];
11  }
12 
13  protected function container($content,$display){
14  if($this->listId){
15  if(!is_array($options = $this->_widget->options)) $options = array_column(
16  $this->_widget->provider->search([],[],$this->_widget->params,0,$this->_widget->batchSize),
17  $this->_widget->code
18  );
19  $content .= $this->html->datalist($options,null,$this->listId);
20  }
21  return parent::container($content,$display);
22  }
23 
24  protected function getListId(){
25  if($this->_listId === null) $this->_listId = $this->_widget->options && ($this->_widget->display >= \Rsi\Fred\Controller\Widget::DISPLAY_WRITEABLE) ? 'list-' . $this->_id : false;
26  return $this->_listId;
27  }
28 
29 }
Rsi\Fred\Controller\View\Html\Widget\Lookup\container
container($content, $display)
Definition: Lookup.php:13
Rsi\Fred\Controller\View\Html\Widget\Lookup\attribs
attribs()
Definition: Lookup.php:9
Rsi\Fred\Controller\$display
$display
Default display mode for widgets.
Definition: Controller.php:25
Rsi\Fred\Controller\View\Html\Widget
Definition: Char.php:3
Rsi\Fred\Controller\View\Html\Widget\Lookup\$_listId
$_listId
Definition: Lookup.php:7
Rsi\Fred\Controller\View\Html\Widget\Char
Definition: Char.php:5
Rsi\Fred\Controller\View\Html\Widget\Lookup\getListId
getListId()
Definition: Lookup.php:24
Rsi\Fred\Controller\View\Html\Widget\Lookup
Definition: Lookup.php:5