# |
Jul 6th 2017, 00:45 |
graziel |
``` |
# |
Jul 6th 2017, 00:44 |
graziel |
you could also use execute https://api.cakephp.org/3.4/class-Cake.Database.Connection.html#_execute as you did but you messed arguments |
# |
Jul 6th 2017, 00:38 |
blackjccl |
Ok i will do the test |
# |
Jul 6th 2017, 00:37 |
graziel |
yup |
# |
Jul 6th 2017, 00:36 |
blackjccl |
I understand the execute I do after the bind |
# |
Jul 6th 2017, 00:34 |
graziel |
https://book.cakephp.org/3.0/en/orm/database-basics.html#binding-values |
# |
Jul 6th 2017, 00:34 |
graziel |
hm i havent used prepared statements like this before but it looks like you have unneeded colon(:) in your bindings |
# |
Jul 6th 2017, 00:32 |
blackjccl |
https://book.cakephp.org/3.0/en/orm/query-builder.html#automatically-creating-in-clauses |
# |
Jul 6th 2017, 00:32 |
blackjccl |
Here it mentions |
# |
Jul 6th 2017, 00:31 |
blackjccl |
Cake3 |
# |
Jul 6th 2017, 00:30 |
graziel |
its cake3 or 2? |
# |
Jul 6th 2017, 00:25 |
blackjccl |
If clear according to the documentation has to declare the type of variable, here my code |
# |
Jul 6th 2017, 00:23 |
graziel |
but its like what it says - you are passing something other than expected string |
# |
Jul 6th 2017, 00:22 |
graziel |
it would help if you gist your query |
# |
Jul 6th 2017, 00:14 |
blackjccl |
cannot convert value to string |
# |
Jul 6th 2017, 00:14 |
blackjccl |
When I run a query I get this error |
# |
Jul 6th 2017, 00:10 |
blackjccl |
please help |
# |
Jul 6th 2017, 00:07 |
blackjccl |
Hello |
# |
Jul 5th 2017, 23:18 |
jeremyharris |
cool :+1: |
# |
Jul 5th 2017, 23:18 |
jarard01 |
I don't quite unerstand how it knows to get the template form the config file though |
# |
Jul 5th 2017, 23:18 |
jarard01 |
simply creating the file in config then calling it on the form helper was enough |
# |
Jul 5th 2017, 23:17 |
jarard01 |
ok that works - so I was overcooking it |
# |
Jul 5th 2017, 23:14 |
jeremyharris |
(that’s what you gave me anyway) |
# |
Jul 5th 2017, 23:14 |
jeremyharris |
the name of your templates file in config/ |
# |
Jul 5th 2017, 23:13 |
jarard01 |
that will work, what is 'templatesConfig' in your example |
# |
Jul 5th 2017, 23:13 |
jeremyharris |
for a per-form basis |
# |
Jul 5th 2017, 23:13 |
jarard01 |
I want to be able to apply certain templlates to different forms |
# |
Jul 5th 2017, 23:13 |
jeremyharris |
you can also use $this->Form->create($context, [‘templates’ => ‘templatesConfig’]) |
# |
Jul 5th 2017, 23:12 |
jarard01 |
ok so I have that already, but because it is in AppView.php the template is applied to all forms |
# |
Jul 5th 2017, 23:12 |
jeremyharris |
in the example in the book, it loads the templates when the helper is loaded |
# |
Jul 5th 2017, 23:11 |
jeremyharris |
https://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses |
# |
Jul 5th 2017, 23:10 |
jarard01 |
is there an example any where? |
# |
Jul 5th 2017, 23:09 |
jeremyharris |
you can pass the name of your template file to FormHelper on create and it will merge them in |
# |
Jul 5th 2017, 23:08 |
jeremyharris |
yep you’re on the right track |
# |
Jul 5th 2017, 23:08 |
jarard01 |
I have a template that I need to use in severla places |
# |
Jul 5th 2017, 23:08 |
jeremyharris |
templates are not loaded into Configure |
# |
Jul 5th 2017, 23:08 |
jeremyharris |
see: https://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses |
# |
Jul 5th 2017, 23:07 |
jarard01 |
but it shouldn't be null should it? |
# |
Jul 5th 2017, 23:07 |
jeremyharris |
that’s not quite how they work, you load them up into the form helper |
# |
Jul 5th 2017, 23:07 |
jarard01 |
but it returns NULL |
# |
Jul 5th 2017, 23:07 |
jarard01 |
then I debug: $this->set('form_templates', Configure::read('Templates')); |