Skip to content

Use CakePHP 6 property and method names in templates - #1114

Merged
LordSimal merged 1 commit into
4.xfrom
4.x-cake6-template-names
Oct 12, 2026
Merged

LordSimal merged 1 commit into
4.xfrom
4.x-cake6-template-names

Conversation

@LordSimal

Copy link
Copy Markdown
Member

Some templates still generate CakePHP 5 names that are silently ignored in 6.x:

  • Form/form.twig: _buildSchema() / _execute() → buildSchema() / process(). Previously, a baked form's process logic never ran, and execute() always returned the parent's default.
  • Controller/component.twig, Model/behavior.twig, View/helper.twig: $_defaultConfig → $defaultConfig. Previously, the defaults were ignored.
  • Command/helper.twig: the doc comment now references $this->io.

FormCommandTest now asserts the generated method names, and the comparison files are updated.

🤖 Generated with Claude Code

The form template still generated `_buildSchema()` and `_execute()`, which
are never called in CakePHP 6 (`buildSchema()` and `process()`). The
component, behavior and helper templates still declared `$_defaultConfig`,
which is ignored now that it is named `$defaultConfig`.
@LordSimal
LordSimal force-pushed the 4.x-cake6-template-names branch from 3304f73 to c3070a2 Compare October 12, 2026 18:20
@LordSimal
LordSimal merged commit 5b58c19 into 4.x Oct 12, 2026
8 checks passed
@LordSimal
LordSimal deleted the 4.x-cake6-template-names branch October 12, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant