mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Optimization in postLink and create methods from FormHelper.
This commit is contained in:
parent
3fc8a1f8c1
commit
ff18fe4e3e
1 changed files with 6 additions and 3 deletions
|
@ -210,11 +210,13 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
}
|
||||
|
||||
$object = $this->_introspectModel($model);
|
||||
$this->setEntity($model . '.', true);
|
||||
if ($model !== false) {
|
||||
$object = $this->_introspectModel($model);
|
||||
$this->setEntity($model . '.', true);
|
||||
}
|
||||
|
||||
$modelEntity = $this->model();
|
||||
if (isset($this->fieldset[$modelEntity]['key'])) {
|
||||
if ($model !== false && isset($this->fieldset[$modelEntity]['key'])) {
|
||||
$data = $this->fieldset[$modelEntity];
|
||||
$recordExists = (
|
||||
isset($this->request->data[$model]) &&
|
||||
|
@ -1322,6 +1324,7 @@ class FormHelper extends AppHelper {
|
|||
unset($options['confirm']);
|
||||
}
|
||||
|
||||
$url = $this->url($url);
|
||||
$formName = uniqid('post_');
|
||||
$out = $this->create(false, array('url' => $url, 'name' => $formName, 'id' => $formName, 'style' => 'display:none;'));
|
||||
if (isset($options['data']) && is_array($options['data'])) {
|
||||
|
|
Loading…
Reference in a new issue