本文整理汇总了PHP中AdminController::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::edit方法的具体用法?PHP AdminController::edit怎么用?PHP AdminController::edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::edit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit($parameter)
{
$this->page_template_id = $this->getPTIFromId($parameter);
$this->set('page_template_id', $this->page_template_id);
$this->loadSubnav($parameter);
parent::edit($parameter);
}
示例2: edit
/**
* Show the form for editing the specified resource.
* GET /users/{id}/edit
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//Estas funciones son para definir que las diferencias de las funciones heredadas del controlador padre
//Es decir aquí se definen las diferencias que hya aocn el controller de AdminController
//Una vez definidas las diferencias se devuelve al controlado padre
unset($this->model->form['password']);
$this->model->form['email'] = 'disabled';
//aquí es caundo devuelvo al controlador padre
return parent::edit($id);
}
示例3: edit
function edit($parameter)
{
$this->checkUserId($parameter);
parent::edit($parameter);
}
示例4: edit
public function edit()
{
$this->configVars();
parent::edit();
}
示例5: edit
public function edit($id = null)
{
$this->MediaFile = parent::edit($id);
$this->data->set('pageTitle', $this->MediaFile->getText('title', $this->MediaFile->filename));
// language and texts
foreach ($this->Languages as $Language) {
$TextModel = $this->MediaFile->{'Text' . String::ucFirst($Language->id)};
$TextModel->MediaFile = $this->MediaFile;
$TextModel->User = $this->UserLogin->User;
$Form = new AdminMediaTextForm();
$Form->attributes->set('name', 'AdminMediaTextForm' . ucfirst($Language->id));
$Form->attributes->set('id', 'AdminMediaTextForm' . ucfirst($Language->id));
$Form->init($this);
$Form->startup();
$Form->configure();
$Form->fromModel($TextModel);
$Form->attributes->set('action', Router::uri());
$Form->language_id->value($Language->id);
$this->data->set('AdminMediaTextForm' . String::ucFirst($Language->id), $Form);
if ($Form->ok() && $this->request->data['language_id'] == $Language->id) {
$Form->toModel($TextModel);
if (!$TextModel->save()) {
$Form->errors = $TextModel->validationErrors;
} else {
$Form->success = __('Erfolgreich :1 gespeichert', $Language->get('name'), FlashMessageType::SUCCESS);
$this->redirect(Router::url());
}
}
}
// newly uploaded files
$this->AdminMediaFileForm->file->mandatory(false);
if ($this->AdminMediaFileForm->ok()) {
$this->AdminMediaFileForm->toModel($this->MediaFile);
if ($newFile = $this->AdminMediaFileForm->file->value()) {
$this->MediaFile->replace($newFile, $this->AdminMediaFileForm->file->originalFilename());
}
if (!$this->MediaFile->save()) {
$this->AdminMediaFileForm->errors = $this->MediaFile->validationErrors;
} else {
$this->FlashMessage->set(__('Erfolgreich gespeichert'), FlashMessageType::SUCCESS);
}
}
}