View_CRUD::addFrame PHP Method

addFrame() public method

The format of $options is the following: array ( 'title'=> 'Click Me' // Header for the column 'label'=> 'Click Me' // Text to put on the button 'icon' => 'click-me' // Icon for button )
public addFrame ( string $name, array $options = [] ) : Page | boolean
$name string Unique name, also button and title default
$options array Options
return Page | boolean Returns object if clicked on popup.
    public function addFrame($name, $options = array())
    {
        if (!$this->model) {
            throw $this->exception('Must set CRUD model first');
        }
        if (!is_array($options)) {
            throw $this->exception('Must be array');
        }
        $s = $this->app->normalizeName($name);
        if ($this->isEditing('fr_' . $s)) {
            $n = $this->virtual_page->name . '_' . $s;
            if ($_GET[$n]) {
                $this->id = $_GET[$n];
                $this->app->stickyGET($n);
            }
            return $this->virtual_page->getPage();
        }
        if ($this->isEditing()) {
            return false;
        }
        $this->virtual_page->addColumn('fr_' . $s, $options['title'] ?: $name, array('descr' => $options['label'] ?: null, 'icon' => $options['icon'] ?: null), $this->grid);
    }