本文整理汇总了PHP中Anomaly\Streams\Platform\Ui\Form\FormBuilder::isReadOnly方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::isReadOnly方法的具体用法?PHP FormBuilder::isReadOnly怎么用?PHP FormBuilder::isReadOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Anomaly\Streams\Platform\Ui\Form\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::isReadOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle the command.
*
* @param Container $container
* @param ViewTemplate $template
* @param BreadcrumbCollection $breadcrumbs
*/
public function handle(Container $container, ViewTemplate $template, BreadcrumbCollection $breadcrumbs)
{
$form = $this->builder->getForm();
if ($handler = $form->getOption('data')) {
$container->call($handler, compact('form'));
}
if ($layout = $form->getOption('layout_view')) {
$template->put('layout', $layout);
}
if ($title = $form->getOption('title')) {
$template->put('title', $title);
}
// Move this to options so we can read it.
$this->builder->setFormOption('read_only', $this->builder->isReadOnly());
$form->addData('form', $form);
if ($breadcrumb = $form->getOption('breadcrumb', 'streams::form.mode.' . $this->builder->getFormMode())) {
$breadcrumbs->put($breadcrumb, '#');
}
}
示例2: guess
/**
* Guess the field instructions.
*
* @param FormBuilder $builder
*/
public function guess(FormBuilder $builder)
{
$fields = $builder->getFields();
if (!($readOnly = $builder->isReadOnly())) {
return;
}
foreach ($fields as &$field) {
$field['read_only'] = true;
$field['disabled'] = true;
}
$builder->setFields($fields);
}