# |
Dec 10th 2019, 22:42 |
ricksaccous |
it depends how you are handling the submission |
# |
Dec 10th 2019, 22:42 |
damiano |
@ricksaccous yes the form works correctly, but i do not see the values i have inserted after the submit |
# |
Dec 10th 2019, 22:39 |
dereuromark |
Docs explain valueSources, jep |
# |
Dec 10th 2019, 22:38 |
ricksaccous |
actually @damiano it's explained here https://book.cakephp.org/3/en/views/helpers/form.html#getting-form-values-from-the-query-string |
# |
Dec 10th 2019, 22:37 |
ricksaccous |
also why would you want get to populate input fields? why would you rather get than post? |
# |
Dec 10th 2019, 22:32 |
ricksaccous |
not sure if that matters but it might |
# |
Dec 10th 2019, 22:32 |
ricksaccous |
did you specify the form type? |
# |
Dec 10th 2019, 22:32 |
damiano |
only with POST data |
# |
Dec 10th 2019, 22:32 |
damiano |
hello, why GET form does not populate the input fields ? |
# |
Dec 10th 2019, 22:15 |
challgren |
@kevin.pfeifer in my implementation for a bunch of stats from different tables. I built a view and then manually query it |
# |
Dec 10th 2019, 21:40 |
kevin.pfeifer |
ok thx, will try that :+1: |
# |
Dec 10th 2019, 21:40 |
ricksaccous |
you'll prob count Books.id |
# |
Dec 10th 2019, 21:39 |
ricksaccous |
https://book.cakephp.org/3/en/orm/query-builder.html#aggregates-group-and-having this has a small sample |
# |
Dec 10th 2019, 21:39 |
kevin.pfeifer |
thought i could do that with just a contain |
# |
Dec 10th 2019, 21:38 |
kevin.pfeifer |
ah, i have to make a left join, forgot that |
# |
Dec 10th 2019, 21:38 |
ricksaccous |
https://book.cakephp.org/3/en/orm/query-builder.html |
# |
Dec 10th 2019, 21:38 |
ricksaccous |
to get a better idea read docs on QueryBuilder |
# |
Dec 10th 2019, 21:38 |
ricksaccous |
$authorsTable->find()->select(['count_of_books' => something_goes_here], other_fields)->leftJoinWith('Books'); |
# |
Dec 10th 2019, 21:36 |
kevin.pfeifer |
Another Question: I got following DB Structure: 1 Book has many Authors 1 Author has many Books Therfore I have a HABTM between those 2. This basically is set up and works correctly. Now I want to make a query which outputs all the Authors and the amount of books they have written. How should this Query look like in CakePHP 3? |
# |
Dec 10th 2019, 19:47 |
jotpe |
@koeller you're Welcome. Cool that you found it :+1: |
# |
Dec 10th 2019, 19:22 |
koeller |
@jotpe: I got it. Your input gave me clue. I’m loading a new configuration in a Middleware and that sets App.fullBaseUrl to false again. As the bootstrap code already did run to that point, I’m now storing my fullBaseUrl in a variable. Thank you, again :slightly_smiling_face: |
# |
Dec 10th 2019, 19:11 |
kevin.pfeifer |
@admad thx, i will look into that |
# |
Dec 10th 2019, 19:11 |
admad |
@kevin.pfeifer view cells |
# |
Dec 10th 2019, 19:10 |
koeller |
@jotpe Hmm, I thought when I set it to false, that in bootstrap it would get created automatically |
# |
Dec 10th 2019, 19:10 |
kevin.pfeifer |
hello Cake Community, how do I implement something like a "Statistics" Page which would read out and display data from like 20 models? |
# |
Dec 10th 2019, 16:52 |
jotpe |
@koeller Did you set *fullBaseUrl* in your config? |
# |
Dec 10th 2019, 16:44 |
damiano |
basically i have to load a select based on an option of another selectù |
# |
Dec 10th 2019, 16:44 |
damiano |
guy i have to load a select with javascript, how can i avoid problem with Security component? |
# |
Dec 10th 2019, 16:38 |
koeller |
Hi everybody, Anyone knows why Router::fullBaseUrl() returns false. I would expect ```Router::url(['controller' => 'posts'], true)``` to return full url, like: www.mypage.com/posts but it only returns, /posts. |
# |
Dec 10th 2019, 16:10 |
gianmarxgagliardi |
@neon1024 thanks I owe you an espresso |
# |
Dec 10th 2019, 16:08 |
neon1024 |
Dot notation only works in methods which take a string as parameter generally. Such as the `read()` method you pasted above |
# |
Dec 10th 2019, 16:08 |
gianmarxgagliardi |
it works |
# |
Dec 10th 2019, 16:08 |
gianmarxgagliardi |
`$loggedInUser[nome]` |
# |
Dec 10th 2019, 16:08 |
neon1024 |
Your pasted data, looks like an array. So perhaps you meant `$loggedInUser['name']` |
# |
Dec 10th 2019, 16:07 |
neon1024 |
This isn’t even valid PHP |
# |
Dec 10th 2019, 16:07 |
neon1024 |
Why do you think this is valid? `$loggedInUser.nome` |
# |
Dec 10th 2019, 16:01 |
gianmarxgagliardi |
`<?php debug($loggedInUser.nome);?>`: Use of undefined constant nome - assumed 'nome' `<?php debug($loggedInUser->nome);?>`:Trying to get property 'nome' of non-object |
# |
Dec 10th 2019, 15:57 |
slackebot2 |
'fixedNowTime' => false }, 'modified' => object(Cake\I18n\FrozenTime) { 'time' => '2019-12-10T14:17:56+00:00', 'timezone' => 'UTC', 'fixedNowTime' => false } ]``` |
# |
Dec 10th 2019, 15:57 |
gianmarxgagliardi |
from this data structure how do i get the _nome_ field? `<?php $loggedInUser= $this->request->session()->read('Auth.User')?>` `<?php debug($loggedInUser);?>` I print the following data structure: ``` 'id' => (int) 1, 'email' => 'bigben@gmail.com', 'cognome' => 'Siffredi', 'nome' => 'Rocco', 'role' => 'admin', 'created' => object(Cake\I18n\FrozenTime) { 'time' => '2019-12-10T14:17:56+00:00', 'timezone' => 'UTC', |
# |
Dec 10th 2019, 13:33 |
martin |
@ndm we here at work al surprised that it was 2.x documentation. but we missed it that it was a special cookbook only for migrations :P |
# |
Dec 10th 2019, 13:26 |
javier.villanueva |
https://book.cakephp.org/3/en/development/testing.html |