# |
Jul 9th 2018, 01:33 |
waspinator |
guess cake checks for that before calling beforeSave |
# |
Jul 9th 2018, 01:32 |
waspinator |
ah, it wasn't being called because nothing about the object changed. |
# |
Jul 9th 2018, 01:04 |
waspinator |
hmm, so I call `$this->ModelName->save($model);` and I have a `debub('test'); die;` in the `beforeSave()` function, but it's not called |
# |
Jul 9th 2018, 00:13 |
itmpls |
I'm overriding the ExceptionHandler in config/app.php with my own, but I find lately with 3.6+ I don't think it's catching middleware exceptions. Is there a special case/exception for these? Debugging in src/Error/Middleware/ErrorHandlerMiddleware now. |
# |
Jul 8th 2018, 23:09 |
chris-andre |
Before the class UsersTable, «use Cake\Event\Event» and so on to import the classes. You have to use Event, EntityInterface and ArrayObject |
# |
Jul 8th 2018, 22:19 |
waspinator |
besides putting the function in my table class, what else do I have to do? |
# |
Jul 8th 2018, 22:18 |
waspinator |
what was that last part? |
# |
Jul 8th 2018, 21:24 |
chris-andre |
Put it in your table class. That is it. Remember du use the classes Event, EntityInterface an ArrayObject |
# |
Jul 8th 2018, 21:23 |
chris-andre |
‘ beforeSave(Event $event, EntityInterface $entity, ArrayObject $options)’ |
# |
Jul 8th 2018, 21:11 |
waspinator |
I'm trying to call `beforeSave` in a table, but it doesn't seem to be triggered. All I did was define a `public function beforeSave($event, $entity, $options){}` in my `*Table.php` file. Do I have to initilize an event listener for it to work? |
# |
Jul 8th 2018, 19:47 |
saeideng |
are you feeling ? |
# |
Jul 8th 2018, 19:46 |
saeideng |
looks firefox style changed today |
# |
Jul 8th 2018, 17:56 |
wYm |
Hi All, how can I reset data post after a submit |
# |
Jul 8th 2018, 16:04 |
itmpls |
@turkles err what's the difference again? can you elaborate? |
# |
Jul 8th 2018, 11:14 |
turkles |
Hi all, I need to rank some stuff. I have a 'global' ranking ladder of about 100 players, and then they have matches in which players are ranked 1-8. I want to adjust the ladder if the rankings of the 8 in a match is different to how they are ranked in the ladder. Is there something in cake that can help me with this? |
# |
Jul 8th 2018, 07:03 |
braeden |
ensure that the configuration file you've edited is the one that PHP is actually using |
# |
Jul 8th 2018, 07:03 |
braeden |
php --ini ? |
# |
Jul 8th 2018, 06:55 |
zhyeap |
no output....(cd to the cakephp folder) |
# |
Jul 8th 2018, 06:52 |
braeden |
What's the output? |
# |
Jul 8th 2018, 06:52 |
braeden |
php -m | grep intl |
# |
Jul 8th 2018, 05:49 |
zhyeap |
File uploaded https://cakesf.slack.com/files/UBL5N21Q9/FBLMGDHH8/screenshot_2018-07-08_at_1.42.09_pm.png / https://slack-files.com/T053DPNCM-FBLMGDHH8-9d8178a535 - got this prob during my first CakePhp project creation, I'd already enabled the "Intl extension" in php.ini file, I'm using MacOs, php version 7.1.17 andamp; MAMP as I encountered the same problem in XAMPP also, appreciate if someone could help me out. |
# |
Jul 8th 2018, 05:48 |
zhyeap |
can I get some lil help here |
# |
Jul 8th 2018, 05:48 |
zhyeap |
hey |
# |
Jul 8th 2018, 01:35 |
braeden |
No, that's silly, guess my sync wasn't saving the file to the production server ^__^ |
# |
Jul 8th 2018, 01:29 |
braeden |
Oh nevermind, I guess the finder method needs to be defined before ::initialize() is called on the associated table |
# |
Jul 8th 2018, 01:25 |
braeden |
Using setFinder('all') works fine, of course |
# |
Jul 8th 2018, 01:25 |
braeden |
When using the \Cake\ORM\Table::setFinder() method for associations, in which class should the custom finder method be placed? I've tried both tables and it's throwing an 'Unknown finder method' error. |
# |
Jul 8th 2018, 01:08 |
braeden |
I usually do things the stupid way first, and then find out that Cake had a solution all along... *sigh* |
# |
Jul 8th 2018, 01:07 |
itmpls |
:slightly_smiling_face: |
# |
Jul 8th 2018, 01:04 |
braeden |
I just discovered the Table::setConditions method and it's made my morning :P |
# |
Jul 7th 2018, 20:05 |
itmpls |
ah ok |
# |
Jul 7th 2018, 20:05 |
saeideng |
if no, use your own connect |
# |
Jul 7th 2018, 20:04 |
saeideng |
you can use it if you like |
# |
Jul 7th 2018, 20:04 |
saeideng |
just 2 line for connect |
# |
Jul 7th 2018, 20:04 |
saeideng |
``` public function fallbacks($routeClass = null) { $routeClass = $routeClass ?: $this->_routeClass; $this->connect('/:controller', ['action' => 'index'], compact('routeClass')); $this->connect('/:controller/:action/*', [], compact('routeClass')); } ``` |
# |
Jul 7th 2018, 20:04 |
saeideng |
this is cake fallback code |
# |
Jul 7th 2018, 20:04 |
itmpls |
maybe ill change the order.. |
# |
Jul 7th 2018, 20:03 |
saeideng |
ok |
# |
Jul 7th 2018, 20:03 |
itmpls |
if I removed $routes->fallbacks(DashedRoute::class); yes |
# |
Jul 7th 2018, 20:03 |
saeideng |
it worked ? |
# |
Jul 7th 2018, 20:03 |
itmpls |
maybe with that cakephp issue recommendation of SubdomainRouter.. |