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 }
$display
Default display mode for widgets.
Definition: Controller.php:24