From ea729a8b6989312b91cbef26d6bf49672cbc7ab2 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 6 Sep 2025 17:00:09 -0400 Subject: [PATCH 1/5] Use line stripping control structures for easier to read and maintain templates. --- templates/bake/Controller/controller.twig | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/bake/Controller/controller.twig b/templates/bake/Controller/controller.twig index 83a843e1..3212114f 100644 --- a/templates/bake/Controller/controller.twig +++ b/templates/bake/Controller/controller.twig @@ -32,7 +32,7 @@ {% endif %} {%- for component in components %} -{% set classInfo = Bake.classInfo(component, 'Controller/Component', 'Component') %} + {%~ set classInfo = Bake.classInfo(component, 'Controller/Component', 'Component') %} * @property {{ classInfo.fqn }} ${{ classInfo.name }} {% endfor %} */ @@ -48,20 +48,20 @@ class {{ name }}Controller extends AppController { parent::initialize(); -{% for component in components %} + {%~ for component in components %} $this->loadComponent('{{ component }}'); -{% endfor %} -{% if helpers %} + {%~ endfor %} + {%~ if helpers %} $this->viewBuilder()->setHelpers({{ Bake.exportArray(helpers)|raw }}); -{% endif %} -{% if has_login %} + {%~ endif %} + {%~ if has_login %} $this->Authentication->allowUnauthenticated(['login']); -{% endif %} + {%~ endif %} } -{% if actions|length %}{{ "\n" }}{% endif %} + {%~ if actions|length %}{{ "\n" }}{% endif %} {% endif %} -{%- for action in actions %} -{% if loop.index > 1 %}{{ "\n" }}{% endif %} +{% for action in actions %} + {%~ if loop.index > 1 %}{{ "\n" }}{% endif %} {{- element('Bake.Controller/' ~ action) -}} {% endfor %} } From a66e1db5a6b73fa5c28e9b432a5408c1573d19ab Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 6 Sep 2025 17:03:46 -0400 Subject: [PATCH 2/5] Use line stripping for form template --- templates/bake/element/form.twig | 43 +++++++++++++------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/templates/bake/element/form.twig b/templates/bake/element/form.twig index f442cbd0..8036cfe6 100644 --- a/templates/bake/element/form.twig +++ b/templates/bake/element/form.twig @@ -26,8 +26,7 @@ ) ?> {% endif %} Html->link(__('List {{ pluralHumanName }}'), ['action' => 'index'], ['class' => 'side-nav-item']) ?> - {{- "\n" }} -{%- set done = [] %} +{% set done = [] %}
@@ -37,34 +36,28 @@ Form->control('{{ field }}', ['options' => ${{ keyFields[field] }}, 'empty' => true]); - {{- "\n" }} - {%- else %} + {%~ else %} echo $this->Form->control('{{ field }}', ['options' => ${{ keyFields[field] }}]); - {{- "\n" }} - {%- endif %} - {%- elseif field not in ['created', 'modified', 'updated'] %} - {%- set fieldData = Bake.columnData(field, schema) %} - {%- if fieldData.type in ['date', 'datetime', 'time'] and fieldData.null %} + {%~ endif %} + {%~ elseif field not in ['created', 'modified', 'updated'] %} + {%~ set fieldData = Bake.columnData(field, schema) %} + {%~ if fieldData.type in ['date', 'datetime', 'time'] and fieldData.null %} echo $this->Form->control('{{ field }}', ['empty' => true]); - {{- "\n" }} - {%- else %} + {%~ else %} echo $this->Form->control('{{ field }}'); - {{- "\n" }} - {%- endif %} - {%- endif %} -{%- endif %} -{%- endfor %} - -{%- if associations.BelongsToMany is defined %} -{%- for assocName, assocData in associations.BelongsToMany %} + {%~ endif %} + {%~ endif %} + {%~ endif %} +{% endfor %} +{% if associations.BelongsToMany is defined %} + {%~ for assocName, assocData in associations.BelongsToMany %} echo $this->Form->control('{{ assocData.property }}._ids', ['options' => ${{ assocData.variable }}]); - {{- "\n" }} -{%- endfor %} + {%~ endfor %} {% endif %} ?> From 29f7caeb9f0faa50787d360453f85842fc70602e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 6 Sep 2025 17:19:07 -0400 Subject: [PATCH 3/5] Update more templates to use line stripping blocks --- templates/bake/Model/entity.twig | 10 +- templates/bake/Model/table.twig | 107 ++++++++------------ templates/bake/element/Controller/add.twig | 7 +- templates/bake/element/Controller/edit.twig | 7 +- 4 files changed, 56 insertions(+), 75 deletions(-) diff --git a/templates/bake/Model/entity.twig b/templates/bake/Model/entity.twig index 0885b7fc..ab924dd7 100644 --- a/templates/bake/Model/entity.twig +++ b/templates/bake/Model/entity.twig @@ -18,8 +18,8 @@ {% set annotations = DocBlock.propertyHints(propertyHintMap) %} {%- if associationHintMap %} - {%- set annotations = annotations|merge(['']) %} - {%- set annotations = annotations|merge(DocBlock.propertyHints(associationHintMap)) %} + {%~ set annotations = annotations|merge(['']) %} + {%~ set annotations = annotations|merge(DocBlock.propertyHints(associationHintMap)) %} {% endif %} {%- set accessible = Bake.getFieldAccessibility(fields, primaryKey) %} @@ -39,7 +39,7 @@ class {{ name }} extends Entity{{ fileBuilder.classBuilder.implements ? ' implem {% endif %} {% if accessible %} -{%- set generatedProperties = generatedProperties|merge(['_accessible']) %} +{%~ set generatedProperties = generatedProperties|merge(['_accessible']) %} /** * Fields that can be mass assigned using newEntity() or patchEntity(). * @@ -54,8 +54,8 @@ class {{ name }} extends Entity{{ fileBuilder.classBuilder.implements ? ' implem {% if accessible and hidden %} {% endif %} -{%- if hidden %} -{%- set generatedProperties = generatedProperties|merge(['_hidden']) %} +{% if hidden %} + {%~ set generatedProperties = generatedProperties|merge(['_hidden']) %} /** * Fields that are excluded from JSON versions of the entity. * diff --git a/templates/bake/Model/table.twig b/templates/bake/Model/table.twig index acd786fa..3a9624af 100644 --- a/templates/bake/Model/table.twig +++ b/templates/bake/Model/table.twig @@ -50,58 +50,43 @@ class {{ name }}Table extends Table{{ fileBuilder.classBuilder.implements ? ' im {%- if displayField %} $this->setDisplayField({{ (displayField is iterable ? Bake.exportArray(displayField) : Bake.exportVar(displayField))|raw }}); {% endif %} - -{%- if primaryKey %} - {%- if primaryKey is iterable and primaryKey|length > 1 %} +{% if primaryKey %} + {%~ if primaryKey is iterable and primaryKey|length > 1 %} $this->setPrimaryKey({{ Bake.exportArray(primaryKey)|raw }}); - {{- "\n" }} - {%- else %} + {%~ else %} $this->setPrimaryKey('{{ primaryKey|as_array|first }}'); - {{- "\n" }} - {%- endif %} + {%~ endif %} {% endif %} +{% if enums %} -{%- if enums %} - -{% endif %} - -{%- if enums %} - -{%- for name, className in enums %} + {%~ for name, className in enums %} $this->getSchema()->setColumnType('{{ name }}', \Cake\Database\Type\EnumType::from(\{{ className }}::class)); -{% endfor %} + {%~ endfor %} {% endif %} +{% if behaviors %} -{%- if behaviors %} - -{% endif %} - -{%- for behavior, behaviorData in behaviors %} + {%~ for behavior, behaviorData in behaviors %} $this->addBehavior('{{ behavior }}'{{ (behaviorData ? (", " ~ Bake.exportArray(behaviorData, 2)|raw ~ '') : '')|raw }}); -{% endfor %} - -{%- if associations.belongsTo or associations.hasMany or associations.belongsToMany %} - + {%~ endfor %} {% endif %} - -{%- for type, assocs in associations %} - {%- for assoc in assocs %} - {%- set assocData = [] %} - {%- for key, val in assoc %} - {%- if key is not same as('alias') %} - {%- set assocData = assocData|merge({(key): val}) %} - {%- endif %} - {%- endfor %} +{% if associations.belongsTo or associations.hasMany or associations.belongsToMany %} + + {%~ for type, assocs in associations %} + {%~ for assoc in assocs %} + {%~ set assocData = [] %} + {%~ for key, val in assoc %} + {%~ if key is not same as('alias') %} + {%~ set assocData = assocData|merge({(key): val}) %} + {%~ endif %} + {%~ endfor %} $this->{{ type }}('{{ assoc.alias }}', {{ Bake.exportArray(assocData, 2)|raw }}); - {{- "\n" }} - {%- endfor %} -{% endfor %} + {%~ endfor %} + {%~ endfor %} +{% endif %} } -{{- "\n" }} - -{%- if validation %} -{% set generatedFunctions = generatedFunctions|merge(['validationDefault']) %} +{% if validation %} + {%~ set generatedFunctions = generatedFunctions|merge(['validationDefault']) %} /** * Default validation rules. * @@ -110,25 +95,24 @@ class {{ name }}Table extends Table{{ fileBuilder.classBuilder.implements ? ' im */ public function validationDefault(Validator $validator): Validator { -{% for field, rules in validation %} -{% set validationMethods = Bake.getValidationMethods(field, rules) %} -{% if validationMethods %} + {%~ for field, rules in validation %} + {%~ set validationMethods = Bake.getValidationMethods(field, rules) %} + {%~ if validationMethods %} $validator -{% for validationMethod in validationMethods %} -{% if loop.last %} -{% set validationMethod = validationMethod ~ ';' %} -{% endif %} + {%~ for validationMethod in validationMethods %} + {%~ if loop.last %} + {%~ set validationMethod = validationMethod ~ ';' %} + {%~ endif %} {{ validationMethod|raw }} -{% endfor %} + {%~ endfor %} -{% endif %} -{% endfor %} + {%~ endif %} + {%~ endfor %} return $validator; } {% endif %} - {%- if rulesChecker %} -{% set generatedFunctions = generatedFunctions|merge(['buildRules']) %} + {%~ set generatedFunctions = generatedFunctions|merge(['buildRules']) %} /** * Returns a rules checker object that will be used for validating @@ -139,21 +123,20 @@ class {{ name }}Table extends Table{{ fileBuilder.classBuilder.implements ? ' im */ public function buildRules(RulesChecker $rules): RulesChecker { -{% for rule in rulesChecker %} -{% set fields = Bake.exportArray(rule.fields) %} -{% set options = '' %} -{% for optionName, optionValue in rule.options %} - {%~ set options = (loop.first ? '[' : options) ~ "'#{optionName}' => " ~ Bake.exportVar(optionValue) ~ (loop.last ? ']' : ', ') %} -{% endfor %} + {%~ for rule in rulesChecker %} + {%~ set fields = Bake.exportArray(rule.fields) %} + {%~ set options = '' %} + {%~ for optionName, optionValue in rule.options %} + {%~ set options = (loop.first ? '[' : options) ~ "'#{optionName}' => " ~ Bake.exportVar(optionValue) ~ (loop.last ? ']' : ', ') %} + {%~ endfor %} $rules->add($rules->{{ rule.name }}({{ fields|raw }}{{ (rule.extra|default ? ", '#{rule.extra}'" : '')|raw }}{{ (options ? ', ' ~ options : '')|raw }}), ['errorField' => '{{ rule.fields[0] }}']); -{% endfor %} + {%~ endfor %} return $rules; } {% endif %} - -{%- if connection is not same as('default') %} -{% set generatedFunctions = generatedFunctions|merge(['defaultConnectionName']) %} +{% if connection is not same as('default') %} + {%~ set generatedFunctions = generatedFunctions|merge(['defaultConnectionName']) %} /** * Returns the database connection name to use by default. diff --git a/templates/bake/element/Controller/add.twig b/templates/bake/element/Controller/add.twig index 081d1c79..593ae4d4 100644 --- a/templates/bake/element/Controller/add.twig +++ b/templates/bake/element/Controller/add.twig @@ -38,11 +38,10 @@ {% set associations = associations|merge(Bake.aliasExtractor(modelObj, 'BelongsToMany')) %} {%- for assoc in associations %} - {%- set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} - {%- set otherPlural = otherName|variable %} + {%~ set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} + {%~ set otherPlural = otherName|variable %} ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list', limit: 200)->all(); - {{- "\n" }} - {%- set compact = compact|merge(["'#{otherPlural}'"]) %} + {%~ set compact = compact|merge(["'#{otherPlural}'"]) %} {% endfor %} $this->set(compact({{ compact|join(', ')|raw }})); } diff --git a/templates/bake/element/Controller/edit.twig b/templates/bake/element/Controller/edit.twig index 793f8515..4e0b97d9 100644 --- a/templates/bake/element/Controller/edit.twig +++ b/templates/bake/element/Controller/edit.twig @@ -39,11 +39,10 @@ $this->Flash->error(__('The {{ singularHumanName|lower }} could not be saved. Please, try again.')); } {% for assoc in belongsTo|merge(belongsToMany) %} - {%- set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} - {%- set otherPlural = otherName|variable %} + {%~ set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} + {%~ set otherPlural = otherName|variable %} ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list', limit: 200)->all(); - {{- "\n" }} - {%- set compact = compact|merge(["'#{otherPlural}'"]) %} + {%~ set compact = compact|merge(["'#{otherPlural}'"]) %} {% endfor %} $this->set(compact({{ compact|join(', ')|raw }})); } From 63ac2558897ce3042f0a7ae77d7e2166c30a3c48 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 7 Sep 2025 12:45:22 -0400 Subject: [PATCH 4/5] Fix output leaks in command tests --- tests/TestCase/Command/ModelCommandTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/TestCase/Command/ModelCommandTest.php b/tests/TestCase/Command/ModelCommandTest.php index fe2d14c9..48b3a16a 100644 --- a/tests/TestCase/Command/ModelCommandTest.php +++ b/tests/TestCase/Command/ModelCommandTest.php @@ -1878,7 +1878,7 @@ public function testBakeTableValidation() $name = 'TestBakeArticles'; $args = new Arguments([$name], ['table' => 'bake_articles', 'force' => true], []); - $io = new ConsoleIo($this->_out, $this->_err, $this->_in); + $io = new ConsoleIo(new StubConsoleOutput(), new StubConsoleOutput(), new StubConsoleInput([])); $table = $command->getTable($name, $args); $tableObject = $command->getTableObject($name, $table); @@ -1910,7 +1910,7 @@ public function testBakeTableRules(): void $name = 'UniqueFields'; $args = new Arguments([$name], ['table' => 'unique_fields', 'force' => true], []); - $io = new ConsoleIo($this->_out, $this->_err, $this->_in); + $io = new ConsoleIo(new StubConsoleOutput(), new StubConsoleOutput(), new StubConsoleInput([])); $table = $command->getTable($name, $args); $tableObject = $command->getTableObject($name, $table); @@ -2548,7 +2548,7 @@ public function testBakeTableNullableForeignKey() $name = 'TestBakeArticles'; $args = new Arguments([$name], ['table' => 'bake_articles', 'force' => true], []); - $io = new ConsoleIo($this->_out, $this->_err, $this->_in); + $io = new ConsoleIo(new StubConsoleOutput(), new StubConsoleOutput(), new StubConsoleInput([])); $table = $command->getTable($name, $args); $tableObject = $command->getTableObject($name, $table); From 9cb606bc80d2405a0efc860f89189efbd123ce2a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 7 Sep 2025 12:45:34 -0400 Subject: [PATCH 5/5] Update remaining templates to use line-stripping tags --- templates/bake/Template/add.twig | 15 +++---- templates/bake/Template/edit.twig | 15 +++---- templates/bake/Template/index.twig | 34 +++++++------- templates/bake/Template/view.twig | 70 ++++++++++++++--------------- templates/bake/tests/test_case.twig | 52 ++++++++++----------- 5 files changed, 90 insertions(+), 96 deletions(-) diff --git a/templates/bake/Template/add.twig b/templates/bake/Template/add.twig index c21d7c1d..bfbfcbad 100644 --- a/templates/bake/Template/add.twig +++ b/templates/bake/Template/add.twig @@ -17,18 +17,15 @@ /** * @var \{{ namespace }}\View\AppView $this * @var \{{ entityClass }} ${{ singularVar }} - {{- "\n" }} -{%- if associations.BelongsTo is defined %} - {%- for assocName, assocData in associations.BelongsTo %} +{% if associations.BelongsTo is defined %} + {%~ for assocName, assocData in associations.BelongsTo %} * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} - {{- "\n" }} - {%- endfor %} + {%~ endfor %} {% endif %} -{%- if associations.BelongsToMany is defined %} - {%- for assocName, assocData in associations.BelongsToMany %} +{% if associations.BelongsToMany is defined %} + {%~ for assocName, assocData in associations.BelongsToMany %} * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} - {{- "\n" }} - {%- endfor %} + {%~ endfor %} {% endif %} */ ?> diff --git a/templates/bake/Template/edit.twig b/templates/bake/Template/edit.twig index 90fed4ec..a7d57e8f 100644 --- a/templates/bake/Template/edit.twig +++ b/templates/bake/Template/edit.twig @@ -17,18 +17,15 @@ /** * @var \{{ namespace }}\View\AppView $this * @var \{{ entityClass }} ${{ singularVar }} - {{- "\n" }} -{%- if associations.BelongsTo is defined %} - {%- for assocName, assocData in associations.BelongsTo %} +{% if associations.BelongsTo is defined %} + {%~ for assocName, assocData in associations.BelongsTo %} * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} - {{- "\n" }} - {%- endfor %} + {%~ endfor %} {% endif %} -{%- if associations.BelongsToMany is defined %} - {%- for assocName, assocData in associations.BelongsToMany %} +{% if associations.BelongsToMany is defined %} + {%~ for assocName, assocData in associations.BelongsToMany %} * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} - {{- "\n" }} - {%- endfor %} + {%~ endfor %} {% endif %} */ ?> diff --git a/templates/bake/Template/index.twig b/templates/bake/Template/index.twig index 7cab8aa1..4a81b76f 100644 --- a/templates/bake/Template/index.twig +++ b/templates/bake/Template/index.twig @@ -38,28 +38,28 @@ {% for field in fields %} -{% set isKey = false %} -{% if associations.BelongsTo is defined %} -{% for alias, details in associations.BelongsTo %} -{% if field == details.foreignKey %} -{% set isKey = true %} + {%~ set isKey = false %} + {%~ if associations.BelongsTo is defined %} + {%~ for alias, details in associations.BelongsTo %} + {%~ if field == details.foreignKey %} + {%~ set isKey = true %} hasValue('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?> -{% endif %} -{% endfor %} -{% endif %} -{% if isKey is not same as(true) %} -{% set columnData = Bake.columnData(field, schema) %} -{% set supportsLabel = Bake.enumSupportsLabel(field, schema) %} -{% if columnData.type starts with 'enum-' %} + {%~ endif %} + {%~ endfor %} + {%~ endif %} + {%~ if isKey is not same as(true) %} + {%~ set columnData = Bake.columnData(field, schema) %} + {%~ set supportsLabel = Bake.enumSupportsLabel(field, schema) %} + {%~ if columnData.type starts with 'enum-' %} {{ field }} === null ? '' : h(${{ singularVar }}->{{ field }}->{% if supportsLabel %}label(){% else %}value{% endif %}) ?> -{% elseif columnData.type not in ['integer', 'float', 'decimal', 'biginteger', 'smallinteger', 'tinyinteger'] %} + {%~ elseif columnData.type not in ['integer', 'float', 'decimal', 'biginteger', 'smallinteger', 'tinyinteger'] %} {{ field }}) ?> -{% elseif columnData.null %} + {%~ elseif columnData.null %} {{ field }} === null ? '' : $this->Number->format(${{ singularVar }}->{{ field }}) ?> -{% else %} + {%~ else %} Number->format(${{ singularVar }}->{{ field }}) ?> -{% endif %} -{% endif %} + {%~ endif %} + {%~ endif %} {% endfor %} {% set pk = '$' ~ singularVar ~ '->' ~ primaryKey[0] %} diff --git a/templates/bake/Template/view.twig b/templates/bake/Template/view.twig index de414135..e4234c0e 100644 --- a/templates/bake/Template/view.twig +++ b/templates/bake/Template/view.twig @@ -24,6 +24,7 @@ {% set associationFields = fieldsData.associationFields %} {% set groupedFields = fieldsData.groupedFields %} {% set pK = '$' ~ singularVar ~ '->' ~ primaryKey[0] %} +{% set done = [] %}
@@ -40,104 +40,104 @@

{{ displayField }}) ?>

{% if groupedFields['string'] %} -{% for field in groupedFields['string'] %} -{% if associationFields[field] is defined %} -{% set details = associationFields[field] %} + {%~ for field in groupedFields['string'] %} + {%~ if associationFields[field] is defined %} + {%~ set details = associationFields[field] %} -{% else %} + {%~ else %} -{% endif %} -{% endfor %} + {%~ endif %} + {%~ endfor %} {% endif %} {% if associations.HasOne %} -{% for alias, details in associations.HasOne %} + {%~ for alias, details in associations.HasOne %} -{% endfor %} + {%~ endfor %} {% endif %} {% if groupedFields.number %} -{% for field in groupedFields.number %} + {%~ for field in groupedFields.number %} -{% set columnData = Bake.columnData(field, schema) %} -{% if columnData.null %} + {%~ set columnData = Bake.columnData(field, schema) %} + {%~ if columnData.null %} -{% else %} + {%~ else %} -{% endif %} + {%~ endif %} -{% endfor %} + {%~ endfor %} {% endif %} {% if groupedFields.enum %} -{% for field in groupedFields.enum %} + {%~ for field in groupedFields.enum %} -{% set columnData = Bake.columnData(field, schema) %} -{% set supportsLabel = Bake.enumSupportsLabel(field, schema) %} -{% if columnData.null %} + {%~ set columnData = Bake.columnData(field, schema) %} + {%~ set supportsLabel = Bake.enumSupportsLabel(field, schema) %} + {%~ if columnData.null %} -{% else %} + {%~ else %} -{% endif %} + {%~ endif %} -{% endfor %} + {%~ endfor %} {% endif %} {% if groupedFields.date %} -{% for field in groupedFields.date %} + {%~ for field in groupedFields.date %} -{% endfor %} + {%~ endfor %} {% endif %} {% if groupedFields.boolean %} -{% for field in groupedFields.boolean %} + {%~ for field in groupedFields.boolean %} -{% endfor %} + {%~ endfor %} {% endif %}
hasValue('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>
{{ field }}) ?>
hasValue('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>
{{ field }} === null ? '' : $this->Number->format(${{ singularVar }}->{{ field }}) ?>Number->format(${{ singularVar }}->{{ field }}) ?>
{{ field }} === null ? '' : h(${{ singularVar }}->{{ field }}->{% if supportsLabel %}label(){% else %}value{% endif %}) ?>{{ field }}->{% if supportsLabel %}label(){% else %}value{% endif %}) ?>
{{ field }}) ?>
{{ field }} ? __('Yes') : __('No'); ?>
{% if groupedFields.text %} -{% for field in groupedFields.text %} + {%~ for field in groupedFields.text %}
Text->autoParagraph(h(${{ singularVar }}->{{ field }})); ?>
-{% endfor %} + {%~ endfor %} {% endif %} {% set relations = associations.BelongsToMany|merge(associations.HasMany) %} {% for alias, details in relations %} -{% set otherSingularVar = alias|singularize|variable %} -{% set otherPluralHumanName = details.controller|underscore|humanize %} + {%~ set otherSingularVar = alias|singularize|variable %} + {%~ set otherPluralHumanName = details.controller|underscore|humanize %}