PHP code example of nattreid / select-box

1. Go to this page and download the library: Download nattreid/select-box library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nattreid / select-box example snippets


protected function createComponentSelectBox() 
{
    $control = new NAttreid\SelectBox\SelectBox;
    $control->setTranslator($this->translator);
    $control->column = 'column';
    $control->name = 'columnName';
    $control->rows = [];
    return $control;
}

protected function createComponentForm()
{
    $form = new \Nette\Forms\Form;
    $form->addHidden('column', $this->defaultValue);
    // dalsi php kod
    return $form;
}

{control selectBox, column => 'nazevPolozkyFormulare', name => 'nazev', rows => $data, $first => 'nazev'}