本文整理汇总了PHP中AdminForm::fillModel方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminForm::fillModel方法的具体用法?PHP AdminForm::fillModel怎么用?PHP AdminForm::fillModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminForm
的用法示例。
在下文中一共展示了AdminForm::fillModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillModel
public function fillModel(Model $model)
{
$r = parent::fillModel($model);
if (substr($this->controller->action, 0, 4) == 'edit' && !$this->submitted()) {
$this->password->value('');
}
return $r;
}
示例2: fillModel
public function fillModel(Model $model)
{
if (count($model->Permissions) > 0) {
foreach ($model->Permissions as $Permission) {
$permissionIds[] = $Permission->id;
}
$permissionField = $this->fieldset->childWithAttribute('name', 'permission_id[]');
$permissionField->select($permissionIds);
}
parent::fillModel($model);
}
示例3: fillModel
public function fillModel(Model $model)
{
parent::fillModel($model);
if (!$this->submitted() && $model instanceof Node) {
if ($this->hasField('allowComments')) {
$this->allowComments->checked($model->hasFlag(NodeFlag::ALLOW_COMMENTS));
}
if ($this->hasField('allowRSS')) {
$this->allowRSS->checked($model->hasFlag(NodeFlag::ALLOW_RSS));
}
if ($this->hasField('user_id')) {
$this->user_id->value($model->get('user_id'));
}
}
}
示例4: fillModel
public function fillModel(Model $model)
{
parent::fillModel($model);
if (!$this->submitted() && $model) {
$this->allowComments->checked($model->hasFlag(BlogPostFlag::ALLOW_COMMENTS));
$this->sticky->checked($model->hasFlag(BlogPostFlag::STICKY));
// tags
if (!empty($model->Tags)) {
$tags = new IndexedArray();
foreach ($model->Tags as $Tag) {
$tags[] = $Tag->get('name');
}
$this->tags->value($tags->implode(' '));
}
}
}