本文整理汇总了PHP中SplSubject::getModelConfigVerify方法的典型用法代码示例。如果您正苦于以下问题:PHP SplSubject::getModelConfigVerify方法的具体用法?PHP SplSubject::getModelConfigVerify怎么用?PHP SplSubject::getModelConfigVerify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplSubject
的用法示例。
在下文中一共展示了SplSubject::getModelConfigVerify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update(\SplSubject $subject)
{
/** @var FormConfigParser $subject */
$modelConfig = $subject->getModelConfigVerify();
$formConfig = ['name' => $modelConfig->model . 'Form', 'group' => 'form', 'type' => 'form', 'options' => ['label' => $modelConfig->model . ' information'], 'attributes' => ['class' => 'validate apiform', 'method' => 'post', 'name' => $modelConfig->model . 'form', 'data-scope' => strtolower($modelConfig->model), 'data-id' => $subject->getDataModel()->id()], 'fieldsets' => [], 'elements' => [], 'filters' => [], 'validationGroup' => []];
$subject->addParsedConfig($formConfig);
}
示例2: update
public function update(\SplSubject $subject)
{
/** @var FormConfigParser $subject */
$modelConfig = $subject->getModelConfigVerify();
$config = [];
// process groups
foreach ($modelConfig->groups as $_grp => $_fls) {
$parsedFSConfig = $this->setParsedFormConfig()->getParsedFormConfigVerify();
if (is_numeric($_grp)) {
$_grp = $_fls;
$_baseFieldSet = $_grp == 'fields';
$_label = $modelConfig->model;
} else {
$_baseFieldSet = isset($_fls['base']) && $_fls['base'] == true;
if (!isset($_fls['label'])) {
$_label = $modelConfig->model;
} else {
$_label = $_fls['label'];
}
}
$parsedFSConfig->name = $modelConfig->model . 'Fieldset';
$parsedFSConfig->group = $_grp;
$parsedFSConfig->type = 'fieldset';
$parsedFSConfig->options = ['label' => $_label];
$parsedFSConfig->attributes = ['name' => $_grp, 'class' => 'table'];
$config['fieldsets'][$_grp] = ['type' => $modelConfig->model . 'Fieldset', 'options' => ['label' => $_label]];
if ($_baseFieldSet == true) {
$config['fieldsets'][$_grp]['options']['use_as_base_fieldset'] = true;
}
$config['fieldsets_configs'][$_grp] = $parsedFSConfig;
}
$subject->addParsedConfig($config);
}