# |
May 26th 2017, 09:31 |
Neon1024 |
Exactly as I did in this project, https://github.com/davidyell/Cricketeer |
# |
May 26th 2017, 09:31 |
Neon1024 |
So when I add a new hasMany association, I can render the template with JS to rename the fields correctly without having to put markup into my JS |
# |
May 26th 2017, 09:30 |
Neon1024 |
So that I can render the template with both PHP and Javascript |
# |
May 26th 2017, 09:30 |
Neon1024 |
I might refactor into something like Mustache templates |
# |
May 26th 2017, 09:30 |
Neon1024 |
As on my edit for hasMany, I need to be able to render the same form multiple times |
# |
May 26th 2017, 09:30 |
Neon1024 |
I’ve gone with elements |
# |
May 26th 2017, 09:24 |
steinkel |
@neon1024 Can I render another template inside a template? > Yes you can use template extension |
# |
May 26th 2017, 09:08 |
kareylo |
Element is for part of static html |
# |
May 26th 2017, 09:06 |
kareylo |
@neon1024 @birdy247 You can use Element or Cell |
# |
May 26th 2017, 08:43 |
Neon1024 |
Guess I’ll smash it out and see how I feel about it later |
# |
May 26th 2017, 08:43 |
Neon1024 |
Ah well, I can’t refactor what I haven’t written |
# |
May 26th 2017, 08:40 |
Neon1024 |
I don’t want to duplicate the code either |
# |
May 26th 2017, 08:40 |
Neon1024 |
Just feels a bit messy and inelegant |
# |
May 26th 2017, 08:40 |
Neon1024 |
So I can wrap the whole thing in a form |
# |
May 26th 2017, 08:40 |
Neon1024 |
So I might need to make elements for just the form fields |
# |
May 26th 2017, 08:40 |
Neon1024 |
But I don’t need a whole form |
# |
May 26th 2017, 08:40 |
Neon1024 |
As I need to be able to add associations on the same form |
# |
May 26th 2017, 08:40 |
birdy247 |
Yes |
# |
May 26th 2017, 08:40 |
Neon1024 |
Elements are the way to go |
# |
May 26th 2017, 08:39 |
birdy247 |
was no 1 answered lol |
# |
May 26th 2017, 08:39 |
birdy247 |
The general answer that came back |
# |
May 26th 2017, 08:39 |
Neon1024 |
Not in the mood for work :( |
# |
May 26th 2017, 08:39 |
Neon1024 |
I could do with a day off today |
# |
May 26th 2017, 08:39 |
Neon1024 |
NOWAIRLY |
# |
May 26th 2017, 08:39 |
birdy247 |
I asked this exact question on Wed |
# |
May 26th 2017, 08:39 |
Neon1024 |
hides |
# |
May 26th 2017, 08:39 |
Neon1024 |
:o |
# |
May 26th 2017, 08:39 |
birdy247 |
Neon1024 |
# |
May 26th 2017, 08:35 |
Neon1024 |
#rubberduck |
# |
May 26th 2017, 08:35 |
Neon1024 |
Guess using an element is probably best thinking about it, as I’ll need to render lots of things in various places |
# |
May 26th 2017, 08:35 |
Neon1024 |
Can I render another template inside a template? Or do I have to convert it to an element? |
# |
May 26th 2017, 08:25 |
chris-andre |
Only way I have been able to bypass that is by using `post` |
# |
May 26th 2017, 08:24 |
chris-andre |
I get 403 Forbidden |
# |
May 26th 2017, 08:24 |
chris-andre |
Yup |
# |
May 26th 2017, 08:24 |
kareylo |
Wow O_o |
# |
May 26th 2017, 08:24 |
chris-andre |
Nothing inside the if is returned. Condition fails |
# |
May 26th 2017, 08:23 |
kareylo |
you don't have any error on save ? |
# |
May 26th 2017, 08:22 |
chris-andre |
`if ($this->request->is(['patch', 'post', 'put'])) {` |
# |
May 26th 2017, 08:22 |
kareylo |
`$this->request->allow(['POST', 'PUT', 'PATCH'])` or something similar ? |
# |
May 26th 2017, 08:22 |
kareylo |
what do you have in controller ? |
# |
May 26th 2017, 08:22 |
chris-andre |
Btw: Now I tested `$this->Form->create($entity, ['type' => 'put'])` which don't saves (updates) the form |