本文整理汇总了PHP中CheckboxField::name方法的典型用法代码示例。如果您正苦于以下问题:PHP CheckboxField::name方法的具体用法?PHP CheckboxField::name怎么用?PHP CheckboxField::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckboxField
的用法示例。
在下文中一共展示了CheckboxField::name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createSliceConfigUploadForm
/**
* @param $config SliceConfig
* @return Form
*/
public function _createSliceConfigUploadForm($config)
{
$form = new Form('upload');
//load up our engines.
if (User::isAdmin()) {
$engines = SliceEngine::getAllEngines()->getAll();
} else {
$engines = SliceEngine::getPublicEngines()->getAll();
}
$engs = array();
foreach ($engines as $row) {
/* @var $e SliceEngine */
$e = $row['SliceEngine'];
$engs[$e->id] = $e->getName();
}
$form->add(SelectField::name('engine_id')->label('Slice Engine')->help('Which slicing engine does this config use?')->required(true)->value($config->get('engine_id'))->options($engs));
$form->add(TextField::name('config_name')->label('Config Name')->help('What is the name of this slicing configuration.')->required(true)->value($config->get('config_name')));
if ($config->isHydrated()) {
$form->add(CheckboxField::name('expire_slicejobs')->label('Expire Old Slice Jobs')->help('If checked, old slice jobs will be expired and never re-used.')->value(1));
}
$form->add(UploadField::name('config_file')->label('Configuration File')->help('The configuration file to use (.ini for Slic3r)')->required(true));
return $form;
}
示例2: _createProfileEditForm
/**
* @param User $user
* @return Form
*/
private function _createProfileEditForm($user)
{
$form = new Form();
$form->add(DisplayField::name('username')->label("Username")->value($user->get('username')));
$form->add(EmailField::name('email')->label("Email")->value($user->get('email'))->required(true));
if (User::$me->isAdmin()) {
$form->add(CheckboxField::name('admin')->label("Is admin?")->help("Is this user an admin?")->checked($user->isAdmin()));
}
// todo add DateField
/**
$form->add(
DateField::name('birthday')
->label("Birthday")
->value($user->get('birthday'))
);
*/
$password_page = $user->getUrl() . "/changepass";
$form->add(DisplayField::name('changepass')->label("Change Password")->value("Please visit the <a href=\"{$password_page}\">change password</a> page."));
return $form;
}
示例3: _createLoginForm
public function _createLoginForm()
{
$form = new Form("login");
$form->action = "/login";
if (!$this->args('username')) {
$username = '';
} else {
$username = $this->args('username');
}
$form->add(HiddenField::name('action')->value('login')->required(true));
$form->add(TextField::name('username')->label('Username')->value($username)->required(true));
$form->add(PasswordField::name('password')->label('Password')->required(true));
$form->add(CheckboxField::name('remember_me')->label("Remember me on this computer.")->checked(true));
$form->setSubmitText("Sign into your account");
$form->setSubmitClass("btn btn-primary btn-large");
return $form;
}
示例4: _createSlicingForm
/**
* @param $bot Bot is the selected bot
* @return form Form the form we return
*/
private function _createSlicingForm($bot)
{
//load up our engines.
if (User::isAdmin()) {
$allEngines = SliceEngine::getAllEngines()->getAll();
} else {
$allEngines = SliceEngine::getPublicEngines()->getAll();
}
$engineList[0] = "None";
foreach ($allEngines as $row) {
/* @var $e SliceEngine */
$e = $row['SliceEngine'];
$engineList[$e->id] = $e->getName();
}
//load up our configs
$engine = $bot->getSliceEngine();
$myConfigs = $engine->getMyConfigs()->getAll();
$configList = array();
if (!empty($myConfigs)) {
foreach ($myConfigs as $row) {
/* @var $c SliceConfig */
$c = $row['SliceConfig'];
$configList[$c->id] = $c->getName();
}
} else {
$configList[0] = "None";
}
$form = new Form('slicing');
if ($this->args('setup')) {
$form->action = $bot->getUrl() . "/edit/setup";
} else {
$form->action = $bot->getUrl() . "/edit";
}
$form->add(DisplayField::name('title')->label('')->value('<h2>Slicing Setup</h2>'));
$config = $bot->getDriverConfig();
$form->add(CheckboxField::name('can_slice')->label('Client Slicing Enabled?')->help('Is the controlling computer fast enough to slice?')->value($config->can_slice));
$form->add(SelectField::name('slice_engine_id')->id('slice_engine_dropdown')->label('Slice Engine')->help('Which slicing engine does this bot use?')->value($bot->get('slice_engine_id'))->options($engineList)->onchange('update_slice_config_dropdown(this)'));
$form->add(SelectField::name('slice_config_id')->id('slice_config_dropdown')->label('Slice Configuration')->help('Which slicing configuration to use? <a href="/slicers">click here</a> to view/edit configs.')->value($bot->get('slice_config_id'))->options($configList));
return $form;
}
示例5: _createJobForm
/**
* @param $file StorageInterface
* @param $queue_id int
* @return Form
*/
private function _createJobForm($file, $queue_id)
{
//load up our queues.
$queues = User::$me->getQueues()->getAll();
$qs = array();
foreach ($queues as $row) {
/* @var $q Queue */
$q = $row['Queue'];
$qs[$q->id] = $q->getName();
}
$form = new Form();
$form->add(DisplayField::name('file_name')->label('File')->help('The file that will be printed.')->value($file->getLink()));
$form->add(SelectField::name('queue_id')->label('Queue')->help('Which queue are you adding this job to?')->required(true)->options($qs)->value($queue_id));
$form->add(TextField::name('quantity')->label('Quantity')->help('How many copies? Minimum 1, Maximum 100')->required(true)->value(1));
$form->add(CheckboxField::name('priority')->label('Is this a priority job?')->help('Check this box to push this job to the top of the queue')->checked(false));
return $form;
}