# |
Jul 5th 2018, 23:59 |
chris-andre |
Is this the best approach to get id's from a form where checked rows shall be updated? `Hash::extract(Hash::extract($this->request->getData(), '{n}[id!=0]'), '{n}.id')` |
# |
Jul 5th 2018, 23:28 |
rightscoreanalysis |
it seems to continue with the rest of the method |
# |
Jul 5th 2018, 23:28 |
rightscoreanalysis |
will my controller return at this point |
# |
Jul 5th 2018, 23:28 |
rightscoreanalysis |
if($foo){ $this->set('_serialize', ['reply']); $this->set(compact('reply')); } |
# |
Jul 5th 2018, 23:28 |
rightscoreanalysis |
if i have json routing enabled and I do this: |
# |
Jul 5th 2018, 22:44 |
chris-andre |
Thinking how to update checked records with a status or delete them. |
# |
Jul 5th 2018, 22:43 |
chris-andre |
Hi. What do you think of this approach, see line 25 and 71: https://gist.github.com/chris-andre/69232e61c2f56ca8a9c62459467e1bf6 |
# |
Jul 5th 2018, 21:30 |
bravo-kernel |
Not saying it can't be done btw, I have often wondered how these folks do it. https://jsonapi-suite.github.io/jsonapi_suite/how-to-autodocument |
# |
Jul 5th 2018, 21:26 |
bravo-kernel |
Hope this is clear. If you have annotations to share I would appreciate it. :thumbsup: |
# |
Jul 5th 2018, 21:25 |
bravo-kernel |
This is not even mentioning the relationships that can exist which makes me wonder how you managed to solve that. |
# |
Jul 5th 2018, 21:22 |
bravo-kernel |
This is not JSON API and I would expect to see something similar to: ```json { "data": { "type": "cocktails", "id": "3", "attributes": { "name": "Mojito", "description": "Rum based", "created": "2015-04-11T09:52:01+00:00", "modified": null } ``` |
# |
Jul 5th 2018, 21:21 |
bravo-kernel |
File uploaded https://cakesf.slack.com/files/U157AT2ET/FBKFGT2E8/image.png / https://slack-files.com/T053DPNCM-FBKFGT2E8-983e12af4b |
# |
Jul 5th 2018, 21:20 |
bravo-kernel |
What does not work (for me) and what I was trying to point out is the `Example Value` which basically should display how the API should respond (circled in red below) |
# |
Jul 5th 2018, 21:18 |
bravo-kernel |
- the `Try it out!` button send the JSON API header and thus the response from crud-json-api is returned in JSON API (which makes total sense) |
# |
Jul 5th 2018, 21:18 |
bravo-kernel |
Results: |
# |
Jul 5th 2018, 21:18 |
bravo-kernel |
- opened the ui |
# |
Jul 5th 2018, 21:17 |
bravo-kernel |
- changed both `consumes` and `produces` to `application/vnd.api+json` (which makes it available in the dropdown selector) |
# |
Jul 5th 2018, 21:17 |
bravo-kernel |
- copied the sample annotations from the cakephp-swagger readme to one of my controllers |
# |
Jul 5th 2018, 21:10 |
bravo-kernel |
@james.phillips I added cakephp-swagger just to make sure I understand correctly. |
# |
Jul 5th 2018, 20:15 |
admad |
hmm sorry, it should work |
# |
Jul 5th 2018, 20:15 |
admad |
@rrd564 what you want isn't supported. Can only load files with templates from app's config/ |
# |
Jul 5th 2018, 20:11 |
admad |
that's already the default |
# |
Jul 5th 2018, 20:04 |
mikesmoniker |
Is there something I can put in my `test` data source config to make sqlite use an in-memory db? |
# |
Jul 5th 2018, 20:04 |
saeideng |
see ^^ |
# |
Jul 5th 2018, 20:04 |
saeideng |
https://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses |
# |
Jul 5th 2018, 20:01 |
saeideng |
see core , probably you able to find your answer |
# |
Jul 5th 2018, 20:00 |
rrd564 |
I almost get what I want with this |
# |
Jul 5th 2018, 20:00 |
saeideng |
i did not test :( |
# |
Jul 5th 2018, 20:00 |
saeideng |
aha |
# |
Jul 5th 2018, 20:00 |
rrd564 |
But I added a template by a plugin |
# |
Jul 5th 2018, 20:00 |
rrd564 |
The form helper is the cake core FormHelper |
# |
Jul 5th 2018, 20:00 |
saeideng |
what you mean of templates? |
# |
Jul 5th 2018, 19:59 |
saeideng |
`loadHelper('pluginName.Form')` |
# |
Jul 5th 2018, 19:59 |
rrd564 |
should I use the dot notaton for the templates like here? |
# |
Jul 5th 2018, 19:58 |
rrd564 |
@saeideng `$this->loadHelper('Form', [ 'templates' => 'Datalist.form-templates', 'widgets' => [ 'datalist' => ['Datalist'] ] ]);` |
# |
Jul 5th 2018, 19:57 |
itmpls |
the read is in plugin/Sites/src/Model/Table/SitesTable.php* |
# |
Jul 5th 2018, 19:57 |
itmpls |
how come Configure::read('Sites.config'); doesnt read what I put in my plugins/Sites/config/bootstrap.php, Configure::write('Sites.config'); ? |
# |
Jul 5th 2018, 19:57 |
saeideng |
loadHelper('plugin.helper')` |
# |
Jul 5th 2018, 19:56 |
saeideng |
`plugin.helper` |
# |
Jul 5th 2018, 19:56 |
rrd564 |
How can I load form helper with a template coming from a plugin? |
# |
Jul 5th 2018, 19:52 |
bravo-kernel |
:face_palm: |