コード例 #1
0
$this->title = __('Settings');
// 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'), __('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
ファイル: install.php プロジェクト: phpffcms/ffcms
<?php

/** @var $model \Apps\Model\Install\Main\FormInstall */
$form = new \Ffcms\Core\Helper\HTML\Form($model, ['class' => 'form-horizontal', 'method' => 'post']);
?>

<h1><?php 
echo __('FFCMS installation');
?>
</h1>
<hr />

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

<h2><?php 
echo __('Database configurations');
?>
</h2>
<?php 
echo $form->field('db.driver', 'select', ['class' => 'form-control', 'options' => ['mysql', 'pgsql']], __('Select database server driver (type). Recommended - mysql'));
echo $form->field('db.host', 'text', ['class' => 'form-control', 'placeHolder' => 'localhost'], __('Hostname or ip:port address of your database server'));
echo $form->field('db.username', 'text', ['class' => 'form-control', 'placeHolder' => 'root'], __('User name for database connection'));
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');
コード例 #3
0
ファイル: form.php プロジェクト: phpffcms/demo-app-package
$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();