Implementing Inflector inside twig file
07:30 05 Nov 2025

How can the Inflector be used in the a twig file?

In this case, I'm trying to use Inflector::camelize() inside my model.twig file:

{%~ if name == assoc.alias %}
    {%~ set x = Inflector::camelize(assocData.joinTable) %}
    $this->{{ type }}('{{ x }}', {{ Bake.exportArray(assocData, 2)|raw }});
{%~ else %}
    $this->{{ type }}('{{ assoc.alias }}', {{ Bake.exportArray(assocData, 2)|raw }});
{%~ endif %}
php cakephp twig cakephp-bake