示例#1
0
$this->breadcrumbs = [Url::to('main/index') => __('Main'), Url::to('application/index') => __('Applications'), Url::to('demoapp/index') => __('Demo app'), __('Settings')];
echo $this->render('_tabs', null, $tplPath);
?>
<h1><?php 
echo __('Demoapp settings');
?>
</h1>
<hr />
<p><?php 
echo __('This page is example to use application configurations');
?>
</p>
<?php 
$form = new \Ffcms\Core\Helper\HTML\Form($model, ['class' => 'form-horizontal', 'method' => 'post']);
?>

<?php 
echo $form->field('textCfg', 'text', ['class' => 'form-control'], __('Test helper for %s%', ['s' => 'textCfg']));
echo $form->field('intCfg', 'text', ['class' => 'form-control'], __('Test helper for %s%', ['s' => 'intCfg']));
echo $form->field('boolCfg', 'checkbox', null, __('Test helper for %s%', ['s' => 'boolCfg']));
?>

<?php 
echo $form->submitButton(__('Save'), ['class' => 'btn btn-default']);
?>

<?php 
echo $form->finish();
?>

示例#2
0
echo $form->field('db.password', 'text', ['class' => 'form-control', 'placeHolder' => 'rootpwd'], __('User password for database connection'));
echo $form->field('db.database', 'text', ['class' => 'form-control', 'placeHolder' => 'ffdb'], __('Database name in database server'));
echo $form->field('db.prefix', 'text', ['class' => 'form-control', 'placeHolder' => 'ffcms_'], __('Table prefix for multiple usage of single database (example: ffcms_)'));
?>

<h2><?php 
echo __('General configurations');
?>
</h2>
<?php 
echo $form->field('mainpage', 'radio', ['options' => ['none' => __('Developer'), 'news' => __('News list'), 'about' => __('About page')], 'optionsKey' => true], __('Select what we should display on the main page. You can always change it in routing configurations'));
echo $form->field('email', 'text', ['class' => 'form-control', 'placeHolder' => '*****@*****.**'], __('Set your general email to use in sendFrom for mailing functions'));
echo $form->field('singleLanguage', 'select', ['class' => 'form-control', 'options' => \App::$Translate->getAvailableLangs()], __('Default language of website'));
echo $form->field('multiLanguage', 'checkbox', ['checked' => true], __('Must we use multi language system in site pathway'));
?>

<h2><?php 
echo __('Administrator account');
?>
</h2>

<?php 
echo $form->field('user.login', 'text', ['class' => 'form-control'], __('Set administrator account login'));
echo $form->field('user.email', 'text', ['class' => 'form-control'], __('Set administrator account email'));
echo $form->field('user.password', 'password', ['class' => 'form-control'], __('Set administrator password'));
echo $form->field('user.repassword', 'password', ['class' => 'form-control'], __('Repeat administrator password'));
echo $form->submitButton(__('Install'), ['class' => 'btn btn-primary']);
?>

<?php 
echo $form->finish();
示例#3
0
$this->title = __('Demo form');
// set breadcrumbs as key->value array (url > text)
$this->breadcrumbs = [Url::to('main/index') => __('Main'), Url::to('application/index') => __('Applications'), Url::to('demoapp/index') => __('Demo app'), __('Demo form')];
// in object initiation views you shall not able to use $this->render or you get deadlock of memory cache
echo (new View('_tabs', null, $tplPath))->render();
?>
<h1><?php 
echo __('Demo form');
?>
</h1>
<hr />
<p><?php 
echo __('This is example of form usage');
?>
.</p>
<?php 
$form = new \Ffcms\Core\Helper\HTML\Form($model, ['class' => 'form-horizontal', 'method' => 'post']);
?>

<?php 
echo $form->field('textProp', 'text', ['class' => 'form-control'], __('Example helper for form text'));
echo $form->field('selectProp', 'select', ['class' => 'form-control', 'options' => ['Test 1', 'Test 2']], __('Example helper for form select options'));
echo $form->field('checkboxProp', 'checkbox', null, __('Example helper for form checkbox'));
?>

<?php 
echo $form->submitButton(__('Send'), ['class' => 'btn btn-primary']);
?>

<?php 
echo $form->finish();