# |
Dec 10th 2016, 21:44 |
savant |
$this->set() is just a method on the controller |
# |
Dec 10th 2016, 21:44 |
dragutux |
err, how so in a this-> set |
# |
Dec 10th 2016, 21:43 |
savant |
you can call ->all(), ->first(), or ->count() on query objects to execute them. |
# |
Dec 10th 2016, 21:43 |
dragutux |
gona try your way :D |
# |
Dec 10th 2016, 21:43 |
savant |
Table::find() returns a query object |
# |
Dec 10th 2016, 21:43 |
savant |
its a method on the query object. |
# |
Dec 10th 2016, 21:43 |
savant |
count isnt a finder anymore |
# |
Dec 10th 2016, 21:43 |
dragutux |
$this->set('articles', $posts); |
# |
Dec 10th 2016, 21:43 |
dragutux |
$posts = $this->paginate($this->Posts); |
# |
Dec 10th 2016, 21:43 |
savant |
$this->Posts->find()->where(['Post.visible' => 1, 'Post.draft' => 0])->count(); |
# |
Dec 10th 2016, 21:43 |
dragutux |
i have the query |
# |
Dec 10th 2016, 21:42 |
savant |
so like |
# |
Dec 10th 2016, 21:42 |
savant |
and then get the count of that query |
# |
Dec 10th 2016, 21:42 |
savant |
you need to construct a query |
# |
Dec 10th 2016, 21:42 |
dragutux |
gives me an " Unknown finder method "count" " error |
# |
Dec 10th 2016, 21:41 |
dragutux |
$this->set('nb_posts', $this->Posts->find('count', array('conditions' => array('Post.visible' => 1, 'Post.draft' => 0)))); |
# |
Dec 10th 2016, 21:41 |
dragutux |
and there are some requests that leave me in WTF mode as i dont see how to transition that code to cake3 |
# |
Dec 10th 2016, 21:41 |
dragutux |
so i've attacked porting an old 2.0 app to cake 3 |
# |
Dec 10th 2016, 21:41 |
dragutux |
hello |
# |
Dec 10th 2016, 20:25 |
savant |
@pop sorry, went to bed, did you figure it out? |
# |
Dec 10th 2016, 20:04 |
GoAway |
styks1987, probably it's right way.Thanks for answer! |
# |
Dec 10th 2016, 20:03 |
styks1987 |
once it succeeds, then do your redirect |
# |
Dec 10th 2016, 20:03 |
styks1987 |
then* |
# |
Dec 10th 2016, 20:03 |
styks1987 |
Most people would validate and if it fails, the don’t redirect, they just reload the same page. |
# |
Dec 10th 2016, 20:02 |
styks1987 |
GoAway: you can either push the validation into the session via session write or send the validation errors as get params on redirect |
# |
Dec 10th 2016, 20:01 |
GoAway |
styks1987, yes but how? I see session already has errors var but it's emty.. |
# |
Dec 10th 2016, 20:00 |
styks1987 |
GoAway: You will have to find some way to send the validation errors in your redirect |
# |
Dec 10th 2016, 19:55 |
GoAway |
hey hey hey |
# |
Dec 10th 2016, 19:53 |
GoAway |
How to get validation errors to view if I return redirect? |
# |
Dec 10th 2016, 19:34 |
nathanpertuset |
Using cake 3, I installed a plugin using composer (php composer.phar require serhioromano/bootstrap-calendar — website: https://github.com/Serhioromano/bootstrap-calendar). Everything is installed to my vendor folder, but how can I include the CSS/JS files (which are currently in vendor/bootstrap-calendar/css/…) in my default template? |
# |
Dec 10th 2016, 17:16 |
styks1987 |
nvm I found it. I wasn’t passing my variable into the sub filtering function so it had not idea what $options meant in the query |
# |
Dec 10th 2016, 17:03 |
styks1987 |
but the actual query in cake doesn’t return anything |
# |
Dec 10th 2016, 17:03 |
styks1987 |
so ->sql() copied into the db gives me results |
# |
Dec 10th 2016, 17:03 |
styks1987 |
hmic: I have tried but the sql query returns results but the cake query does not |
# |
Dec 10th 2016, 16:37 |
hmic |
!tell styks1987 about TIAS |
# |
Dec 10th 2016, 16:18 |
styks1987 |
OR blue or round |
# |
Dec 10th 2016, 16:18 |
styks1987 |
so ->matching(Blue)->matching(Round) would return both blue and round |
# |
Dec 10th 2016, 16:17 |
styks1987 |
anyone here today? Does multiple calls to ->matching mean matching AND or matching OR? |
# |
Dec 10th 2016, 13:01 |
gaetansnl |
Hi, what do you use for complex authorization ? the acl plugin seems to be unfinished ? |
# |
Dec 10th 2016, 09:23 |
cakephp369 |
@ savant, thenks so much, it is uploading and working fine now, but I need some little modification |
# |
Dec 10th 2016, 08:59 |
savant |
in your bootstrap.php |