# |
Dec 10th 2019, 22:44 |
ricksaccous |
haha, no problem |
# |
Dec 10th 2019, 22:44 |
ricksaccous |
but i'm headed off soon so i must simply say good luck |
# |
Dec 10th 2019, 22:44 |
damiano |
thanks! |
# |
Dec 10th 2019, 22:44 |
damiano |
valueSources works perfectly! wow |
# |
Dec 10th 2019, 22:44 |
ricksaccous |
honestly it's a bit hard to imagine your implementation |
# |
Dec 10th 2019, 22:44 |
ricksaccous |
ok |
# |
Dec 10th 2019, 22:44 |
damiano |
@ricksaccous i am using the GET for this reason, i basically submit the form on the same page |
# |
Dec 10th 2019, 22:43 |
ricksaccous |
are you redirecting after submission? |
# |
Dec 10th 2019, 22:43 |
ricksaccous |
if there are no errors and the form submitted, why would you still see anything |
# |
Dec 10th 2019, 22:43 |
damiano |
@ricksaccous what do you mean? |
# |
Dec 10th 2019, 22:42 |
damiano |
i try this |
# |
Dec 10th 2019, 22:42 |
damiano |
```'valueSources' => ['query', 'context']``` |
# |
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. |