Skip to content

Commit

Permalink
Consolidate placeholders to new syntax. Eases 4.x migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 16, 2017
1 parent d171e5e commit bc5de0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/View/Helper/FormHelper.php
Expand Up @@ -1046,13 +1046,13 @@ public function fieldset($fields = '', array $options = [])
}

if ($legend === true) {
$actionName = __d('cake', 'New %s');
$isCreate = $context->isCreate();
$modelName = Inflector::humanize(Inflector::singularize($this->request->getParam('controller')));
if (!$isCreate) {
$actionName = __d('cake', 'Edit %s');
$legend = __d('cake', 'Edit {0}', $modelName);
} else {
$legend = __d('cake', 'New {0}', $modelName);
}
$modelName = Inflector::humanize(Inflector::singularize($this->request->getParam('controller')));
$legend = sprintf($actionName, $modelName);
}

if ($fieldset !== false) {
Expand Down

0 comments on commit bc5de0c

Please sign in to comment.