本文整理匯總了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);
}