本文整理汇总了PHP中Venne\Forms\Form::addTextWithSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addTextWithSelect方法的具体用法?PHP Form::addTextWithSelect怎么用?PHP Form::addTextWithSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::addTextWithSelect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Basic settings');
$form->addSelect('driver', 'Driver')->setItems($this->drivers, false)->setDefaultValue('pdo_mysql');
$form['driver']->addCondition($form::IS_IN, array('pdo_mysql', 'oci8', 'pdo_oci'))->toggle('group-charset');
$form['driver']->addCondition($form::IS_IN, array('pdo_pgsql', 'pdo_mysql', 'oci8', 'pdo_oci', 'pdo_sqlsrv'))->toggle('group-connection');
$form['driver']->addCondition($form::EQUAL, 'pdo_sqlite')->toggle('group-sqlite');
$form->addGroup('Connection settings');
$form->addText('user', 'Username');
$form->addPassword('password', 'Password');
$form->addGroup()->setOption('id', 'group-connection');
$form->addText('host', 'Host');
$form->addText('port', 'Port')->getControlPrototype()->placeholder[] = 'default';
$form->addText('dbname', 'Database');
$form->addGroup()->setOption('id', 'group-sqlite');
$form->addTextWithSelect('path', 'Path')->setItems(array('%tempDir%/database.db'), false);
$form->addCheckbox('memory', 'Db in memory');
$form->addGroup()->setOption('id', 'group-charset');
$form->addTextWithSelect('charset', 'Charset')->setItems(array('utf8'), false);
$backups = $this->getBackups();
if (count($backups)) {
$form->addGroup('Restore from backup');
$form->addSelect('_backup', 'Backup name', $backups)->setPrompt('--------');
}
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例2: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addTextWithSelect('name', 'Name')->setItems(array('English', 'Deutsch', 'Čeština'), false)->setOption('description', '(english, deutsch,...)')->addRule($form::FILLED, 'Please set name');
$form->addTextWithSelect('short', 'Short')->setItems(array('en', 'de', 'cs'), false)->setOption('description', '(en, de,...)')->addRule($form::FILLED, 'Please set short');
$form->addTextWithSelect('alias', 'Alias')->setItems(array('en', 'de', 'cs', 'www'), false)->setOption('description', '(www, en, de,...)')->addRule($form::FILLED, 'Please set alias');
$form->addSaveButton('Save');
}
示例3: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Global meta informations');
$form->addText('name', 'Website name')->addRule($form::FILLED);
$form->addText('title', 'Title')->setOption('description', '(%n - name, %s - separator, %t - local title)');
$form->addText('titleSeparator', 'Title separator');
$form->addText('keywords', 'Keywords');
$form->addText('description', 'Description');
$form->addText('author', 'Author');
$form->addGroup('System');
$form->addTextWithSelect('routePrefix', 'Route prefix');
$form->addTextWithSelect('oneWayRoutePrefix', 'One way route prefix');
$form->addSelect('theme', 'Module width theme', $this->getModules())->setPrompt('off');
$form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off');
$form['cacheMode']->addCondition($form::EQUAL, 'time')->toggle('cacheValue');
$form->addGroup()->setOption('id', 'cacheValue');
$form->addSelect('cacheValue', 'Minutes')->setItems(array(1, 2, 5, 10, 15, 20, 30, 40, 50, 60, 90, 120), FALSE);
$form->setCurrentGroup();
$form->addSaveButton('Save');
}