# |
Apr 14th 2018, 01:43 |
slackebot2 |
= false; //$this->RequestHandler->renderAs($this, 'application/json'); //$this->viewBuilder()->setClassName('Json'); //$this->response = $this->response->withType('json'); //$this->request = $this->request->withParam('_ext', 'json'); $reservations = $this->Reservations->indexData(); // Set the view vars that have to be serialized. $this->set('reservations', $reservations); // Specify |
# |
Apr 14th 2018, 01:43 |
jasmun |
Hi all - trying to wrap my brain around how to use json calls in cake3. I am trying to get a json_encoded array of data from an ajax call. I've tried following the examples given here: https://book.cakephp.org/3.0/en/views/json-and-xml-views.html, but I keep getting a missing template error: `"message": "Template file \u0022Reservations\/json\/index.ctp\u0022 is missing.",` Here is the code that is in my controller: ``` //$this->autoRender |
# |
Apr 13th 2018, 23:18 |
frazr |
and set migration_path inside the environment i guess |
# |
Apr 13th 2018, 23:18 |
frazr |
kinda want to avoid hacking the phinx lib but one solution would be to pass the environment to getMigrations() |
# |
Apr 13th 2018, 23:17 |
frazr |
Doesn't seem to support that |
# |
Apr 13th 2018, 23:11 |
frazr |
when i run eg. phinx migrate B it processses a different migration set than the default "development" environment that is |
# |
Apr 13th 2018, 23:08 |
frazr |
Hi there, anyone familiar with Phinx here? :) im wondering if its possible to have dynamic migration paths, say for example i want environment B to have a certain migration path ? |
# |
Apr 13th 2018, 21:04 |
alexmax |
I'm seeing the panel in the sqlite database |
# |
Apr 13th 2018, 20:54 |
alexmax |
"Requested toolbar does not exist" shows up in the error log |
# |
Apr 13th 2018, 20:53 |
alexmax |
Some of the toolbar options just straight up don't appear to be working |
# |
Apr 13th 2018, 20:53 |
alexmax |
I'm still getting some odd debugkit errors using the latest 3.14.1 |
# |
Apr 13th 2018, 18:29 |
alexmax |
checked out the wrong branch |
# |
Apr 13th 2018, 18:29 |
jeremyharris |
:) |
# |
Apr 13th 2018, 18:29 |
alexmax |
and I didn't download what I thought I did |
# |
Apr 13th 2018, 18:28 |
alexmax |
wait I'm an idiot |
# |
Apr 13th 2018, 18:28 |
alexmax |
`2018-04-13 18:27:13 Warning: Warning (2): Declaration of Cake\Chronos\Traits\FrozenTimeTrait::setTime($hours, $minutes, $seconds = 0) should be compatible with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL) in [/srv/www/op3/dev/app/vendor/cakephp/chronos/src/MutableDate.php, line 24]` |
# |
Apr 13th 2018, 18:28 |
alexmax |
Now I'm having a different problem |
# |
Apr 13th 2018, 18:28 |
alexmax |
Hrm |
# |
Apr 13th 2018, 18:20 |
jeremyharris |
:+1: glad you found it! |
# |
Apr 13th 2018, 18:20 |
alexmax |
you were right on the money |
# |
Apr 13th 2018, 18:20 |
alexmax |
so it wasn't looking at the correct configuration file |
# |
Apr 13th 2018, 18:20 |
alexmax |
We have a "local config" override that I copied over by accident |
# |
Apr 13th 2018, 18:19 |
alexmax |
PBKAC |
# |
Apr 13th 2018, 18:13 |
jeremyharris |
debug kit might just be the first to catch the issue, but I’m sure if you disabled debug kit you’d see other errors related to cache |
# |
Apr 13th 2018, 18:11 |
alexmax |
that might be it, I've just merged two long running branches, and I bet there are some config differences |
# |
Apr 13th 2018, 18:07 |
jeremyharris |
so what’s you’re cache config look like? |
# |
Apr 13th 2018, 18:07 |
jeremyharris |
I don’t think it could even build a cache engine without a class |
# |
Apr 13th 2018, 18:05 |
jeremyharris |
what version of cake? |
# |
Apr 13th 2018, 18:03 |
alexmax |
nope, updating fixed nothing |
# |
Apr 13th 2018, 17:58 |
alexmax |
maybe i should update |
# |
Apr 13th 2018, 17:58 |
alexmax |
according to this I'm using DebugKit 3.2.8 |
# |
Apr 13th 2018, 17:57 |
alexmax |
Notice (8): Undefined index: className [ROOT/vendor/cakephp/debug_kit/src/Panel/CachePanel.php, line 43] |
# |
Apr 13th 2018, 17:57 |
alexmax |
After updating PHP and CakePHP, DebugKit is throwing notices |
# |
Apr 13th 2018, 17:57 |
alexmax |
Hrm, this is weird |
# |
Apr 13th 2018, 17:33 |
vn.sieu |
Okay, I need research more than :slightly_smiling_face: |
# |
Apr 13th 2018, 17:31 |
jeremyharris |
usually I use the existing setup and build off of that |
# |
Apr 13th 2018, 17:31 |
jeremyharris |
the basic skeleton can handle all of those already, however it depends on your application. if you have a JS application that consumes a cake-baked API, then most of your cake app’s templating would not be needed |
# |
Apr 13th 2018, 17:29 |
vn.sieu |
I see, My application have Backend, Frontend, API. I dont know any stucture for it |
# |
Apr 13th 2018, 17:27 |
jeremyharris |
usually cake tries to leave the advanced things up to the dev, because everyone wants something different and cake can do many things |
# |
Apr 13th 2018, 17:27 |
jeremyharris |
@vn.sieu it has a basic skeleton `composer create-project cakephp/app`. what would you like to see in an “advanced” skeleton? |
# |
Apr 13th 2018, 17:26 |
joopm |
it makes scaffold application |