Issue
In the following statement, what is Bake.columnData? This was part of the bake template form.twig.
Where can I find more information of what attributes and methods are available? I'm essentially trying to see what fieldData contains.
{%- set fieldData = Bake.columnData(field, schema) %}
Solution
Bake is a twig style reference to $this->Bake, which is a helper, \Bake\View\Helper\BakeHelper, so Bake.columnData() is basically $this->Bake->columnData().
There's no docs about that specifically, the plugin's Cookbook only describes Twig usage in general, so you'll have to dig through the source code I'm afraid.
It should be noted that Bake uses wyrihaximus/twig-view, you can find more information there about its CakePHP specific features. For debugging purposes there's for example the debug filter (which maps to CakePHP's debug() function), which you could use like this this in your twig template:
{% do Bake.columnData(field, schema)|debug %}
This will dump the debug output in the generated template file, and will look something like:
\vendor\twig\twig\src\Environment.php(418) : eval()'d code (line 103)
########## DEBUG ##########
[
'type' => 'string',
'length' => (int) 255,
'null' => false,
'default' => null,
'collate' => 'utf8_general_ci',
'comment' => '',
'precision' => null
]
###########################
Answered By - ndm
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.