# |
Jul 1st 2019, 13:15 |
dereuromark |
i wonder if the php74 type safety fixes this strange behavior, as this will kill some apps if they internally reassign those to typed properties |
# |
Jul 1st 2019, 13:14 |
admad |
@ndm https://www.php.net/manual/en/language.types.array.php still shows numeric and non-string keys being cast to int. I would expect such a significant change to be well documented |
# |
Jul 1st 2019, 13:10 |
mdotobie |
I actually didn’t know that @ndm. Luckily that isn’t something I do. I never really understood why it was useful anyway. |
# |
Jul 1st 2019, 13:10 |
ndm |
I'd have to look it up |
# |
Jul 1st 2019, 13:10 |
admad |
@ndm that's new to me. Must be 7.3 not 7.2 |
# |
Jul 1st 2019, 13:05 |
ndm |
@mdotobie Correct... it should be noted though, that as of PHP 7.2 (IIRC) it's not possible anymore create arrays with integer string indices. |
# |
Jul 1st 2019, 12:53 |
inoas |
what was the way to teach cakephps orm group by max etc? |
# |
Jul 1st 2019, 12:48 |
mdotobie |
So by that logic @ndm I assume `{s}` will match `'abc'` and `'123'` but not 123 |
# |
Jul 1st 2019, 12:44 |
ndm |
@mdotobie The cookbook is a little unclear/misleading, `{n}` will match numeric keys, which includes numeric strings, ie it will match `123` and `'123'`, but not `'123abc'`. |
# |
Jul 1st 2019, 12:38 |
mdotobie |
okay. I will look a bit deeper. It was more out of curiosity. I use Hash quite a bit and just wanted to get a better sense of how it works. |
# |
Jul 1st 2019, 12:37 |
mdotobie |
I think I understand the docs mention that `{s}` will match numeric strings. If `{n}` only did indexed arrays and `{s}` did associative arrays and `{*}` did both I would get it. But I’m not sure I follow. |
# |
Jul 1st 2019, 12:36 |
admad |
maybe the docs are wrong :slightly_smiling_face: |
# |
Jul 1st 2019, 12:36 |
admad |
check the test cases |
# |
Jul 1st 2019, 12:36 |
admad |
then maybe i am mistaken |
# |
Jul 1st 2019, 12:35 |
mdotobie |
the docs say that `{n}` will match any string key |
# |
Jul 1st 2019, 12:34 |
admad |
{n} for numeric only and {s} for string only |
# |
Jul 1st 2019, 12:31 |
mdotobie |
Can someone explain the use cases of the different Hash Path Expression Types? I’m not sure I understand why there are three different types (`{n}`, `{s}`, `{*}`). Why wouldn’t I just use `{*}` for any type of search? |
# |
Jul 1st 2019, 12:27 |
dereuromark |
how do you handle import of many records with e.g. Tags attached. My problem is that it creates the Tags of the same name multiple times, which it shouldnt. But since unique part is done on patching, the actual saving uplicates Anyone else with this issue for Tags plugin or alike? I might need some more logic on beforeSave probably to handle this.. |
# |
Jul 1st 2019, 12:20 |
hollistergraham123 |
I have the following setup but for some reason it’s only recognizing the table class as Depositlogs not DepositLogs any thoughts |
# |
Jul 1st 2019, 12:04 |
conehead |
Actually seems like this was the problem! |
# |
Jul 1st 2019, 12:04 |
conehead |
ah thank you. I will check that |
# |
Jul 1st 2019, 11:59 |
admad |
@conehead for that e.g. to work you either need to use .json extension in URL (with routes extension enabled) or have `Accept: application/json` header in request |
# |
Jul 1st 2019, 11:57 |
conehead |
Hm, not here |
# |
Jul 1st 2019, 11:57 |
ndm |
@conehead The json/xml views will render without template when encountering the `_serialize` view var. |
# |
Jul 1st 2019, 11:55 |
ndm |
@vossen.steven Yep, the `Plugin.php` file is ment to hold the `Plugin` class if that is what you ment, yes :slightly_smiling_face: |
# |
Jul 1st 2019, 11:53 |
slackebot |
view vars that have to be serialized. $this->set('articles', $this->paginate()); // Specify which view vars JsonView should serialize. $this->set('_serialize', 'articles'); } } ``` Will return a json view, but this still requires a view to be created. Theres not even a hint on that page. |
# |
Jul 1st 2019, 11:53 |
conehead |
Am I confused or am I missing the command `$this->RequestHandler->renderAs($this, 'json');` somewhere in this documentation? https://book.cakephp.org/3.0/en/views/json-and-xml-views.html For me it sounds like using ``` class ArticlesController extends AppController { public function initialize() { parent::initialize(); $this->loadComponent('RequestHandler'); } public function index() { // Set the |
# |
Jul 1st 2019, 11:52 |
vossen.steven |
https://book.cakephp.org/3.0/en/plugins.html#plugin-objects |
# |
Jul 1st 2019, 11:51 |
ndm |
@vossen.steven No sure what exactly you mean? |
# |
Jul 1st 2019, 11:47 |
conehead |
Hm? https://book.cakephp.org/1.1/en/ |
# |
Jul 1st 2019, 11:47 |
vossen.steven |
@ndm I assume thats the point of the plugin.php file then? |
# |
Jul 1st 2019, 11:42 |
ich |
cu |
# |
Jul 1st 2019, 11:42 |
ich |
thank you all |
# |
Jul 1st 2019, 11:42 |
ich |
yeh i know :) |
# |
Jul 1st 2019, 11:42 |
hmic |
°-) |
# |
Jul 1st 2019, 11:41 |
ich |
…5850 |
# |
Jul 1st 2019, 11:41 |
ich |
1.1.18 |
# |
Jul 1st 2019, 11:41 |
hmic |
what does the VERSION.txt read? |
# |
Jul 1st 2019, 11:41 |
ich |
1.1 |
# |
Jul 1st 2019, 11:40 |
ich |
we take more attention to all files :P |
# |
Jul 1st 2019, 11:40 |
hmic |
so, which version is it really? |