# |
Nov 23rd 2017, 21:56 |
ziemmowit |
Hello, does anybody knows how can I catch exceptions in query in controllers? $stars = $this->Stars->find('all'); $stars->join([ 'coo' => [ 'table' => 'coordinates', 'type' => 'LEFT', 'conditions' => 'coo.star_id = Stars.id']]); $stars->distinct(['Stars.id']); $stars->where($str); $stars->limit(100); I would like to to catch the error when `id` or `$str` will generate an error. When I try simple try/catch() nothing happens - seems like |
# |
Nov 23rd 2017, 21:54 |
ziemmowit |
Hello, does anybody knows how can I catch exceptions in query in controllers? $stars = $this->Stars->find('all'); $stars->join([ 'coo' => [ 'table' => 'coordinates', 'type' => 'LEFT', 'conditions' => 'coo.star_id = Stars.id']]); $stars->distinct(['Stars.id']); $stars->where($str); $stars->limit(100); |
# |
Nov 23rd 2017, 20:33 |
mmalex |
hello, any input on https://stackoverflow.com/questions/46215518/cakephp-3-save-empty-belongstomany-relation ? |
# |
Nov 23rd 2017, 18:33 |
admad |
`->config()` |
# |
Nov 23rd 2017, 18:05 |
felix |
when i print `$ds` the config is public |
# |
Nov 23rd 2017, 17:55 |
felix |
how can i retrieve the hostname of a datasource config in cakephp 3? i load the connection by `$ds = ConnectionManager::get($connectionName);` but how do i get the config? `$ds->config` doesn't work |
# |
Nov 23rd 2017, 16:04 |
rajaslack |
Anyone can help me |
# |
Nov 23rd 2017, 15:51 |
rudy1976s |
@neon1024 sounds good indeed |
# |
Nov 23rd 2017, 15:48 |
neon1024 |
`class AppView extends RudyView` |
# |
Nov 23rd 2017, 15:48 |
neon1024 |
So why not extend your projects AppView from your plugins AppView? |
# |
Nov 23rd 2017, 15:46 |
rudy1976s |
@neon1024 I completely agree to extend rather than replacing. |
# |
Nov 23rd 2017, 15:44 |
neon1024 |
Which seems logical |
# |
Nov 23rd 2017, 15:44 |
neon1024 |
This book says to use the `viewBuilder` https://book.cakephp.org/3.0/en/views.html#creating-your-own-view-classes |
# |
Nov 23rd 2017, 15:43 |
neon1024 |
Replacing AppView strikes me as something which would cause me a maintenance headache later on, when I tried to say, load a new helper or something. As I wouldn’t be able to without editing the plugin, or changing the application config |
# |
Nov 23rd 2017, 15:42 |
neon1024 |
Or make it a class alias perhaps? |
# |
Nov 23rd 2017, 15:41 |
neon1024 |
Perhaps it’s as simple as changing the `initialize` method in `src/View/AppView` to be `$rudy = new Rudy(); $rudy->initialize()` |
# |
Nov 23rd 2017, 15:39 |
neon1024 |
You’ll have to find it in the source code |
# |
Nov 23rd 2017, 15:39 |
neon1024 |
No idea |
# |
Nov 23rd 2017, 15:39 |
rudy1976s |
@neon1024 I agree with extending but where can I set to use the extended version in ALL views rather than base one ? I read in the cookbook that once there was RequestHandler to do that, while now I should use config(), but I dont know where |
# |
Nov 23rd 2017, 15:24 |
felix |
hi, i have a database view instead of a table for one of my models. now for the tests ... i'm not sure how to create the database view after the other fixtures have been loaded (precondition because the view is based on the fixtures' tables). should i create a method that runs the custom sql query and call this method after loading the fixtures? or is there another way? |
# |
Nov 23rd 2017, 15:01 |
neon1024 |
If it was me I would extend it, rather than replace it |
# |
Nov 23rd 2017, 14:43 |
rudy1976s |
yes a replacement for the appView |
# |
Nov 23rd 2017, 14:43 |
neon1024 |
Or a template? |
# |
Nov 23rd 2017, 14:43 |
neon1024 |
A new view class? |
# |
Nov 23rd 2017, 14:41 |
rudy1976s |
Good afternoon: I need to create a custom view to use for all my view, which is under a plugin: I am a bit confused where decalring to use my custom view instead AppView |
# |
Nov 23rd 2017, 14:38 |
neon1024 |
How do I add a context to my custom rule? |
# |
Nov 23rd 2017, 14:10 |
dereuromark |
check the version of local vs prod |
# |
Nov 23rd 2017, 14:10 |
dereuromark |
do you have an old version of intl ext? |
# |
Nov 23rd 2017, 14:04 |
joopm |
do you know that what can be the reason why internatiolazation works on local but the same time not on server |
# |
Nov 23rd 2017, 14:04 |
joopm |
have a such a great day to all community members |
# |
Nov 23rd 2017, 14:03 |
joopm |
hello all |
# |
Nov 23rd 2017, 14:03 |
rajaslack |
How to use MySQL locking reads in CakePHP 3.x |
# |
Nov 23rd 2017, 13:44 |
inoas |
very useful $this->Url->assetUrl('/assets/fonts/frutiger-lt-w01/frutiger-lt-w01-47-light-cn.woff2'), |
# |
Nov 23rd 2017, 12:12 |
birdy247 |
I am using the JsonApi for crud |
# |
Nov 23rd 2017, 12:10 |
birdy247 |
@neon1024 I am struggling to take the date and timezone from my api request and manipulate it into my request data so the marshaler picks it up |
# |
Nov 23rd 2017, 12:04 |
neon1024 |
Plus we can recruit Ionas as well! |
# |
Nov 23rd 2017, 12:04 |
neon1024 |
Yeah, if a few of us can get it up to spec perhaps we can add it to Friends of Cake :) |
# |
Nov 23rd 2017, 11:57 |
birdy247 |
I will get it on github |
# |
Nov 23rd 2017, 11:57 |
birdy247 |
I have the plugin |
# |
Nov 23rd 2017, 11:57 |
birdy247 |
@dereuromark ok will do |
# |
Nov 23rd 2017, 11:57 |
dereuromark |
@birdy247 let me know what you need to get things rollin' |