# |
Feb 7th 2018, 15:22 |
popperz0r |
```Class 'App\Event\UserNotification' not found``` |
# |
Feb 7th 2018, 15:22 |
popperz0r |
that isnt working |
# |
Feb 7th 2018, 15:21 |
popperz0r |
```EventManager::instance()->on( new App\Event\UserNotification() );``` |
# |
Feb 7th 2018, 15:21 |
popperz0r |
into |
# |
Feb 7th 2018, 15:21 |
popperz0r |
Hi guys! How can i load a file in src/Event/Folder ? |
# |
Feb 7th 2018, 15:18 |
neon1024 |
When I next think it’s okay to make a ‘manage’ method which does both add and edit. Someone stop me. |
# |
Feb 7th 2018, 14:37 |
admad |
@o0h i'll talk with the team and get it sorted out |
# |
Feb 7th 2018, 14:34 |
admad |
yes that annotation is wrong, `$this->_connection` would be a PDO instance, but if you add `@property \PDO|null $_connection` annotation to Driver class then phpstan complains that lastInsertId() is called with 2 params when PDO::lastInsertId() takes only one :slightly_smiling_face: |
# |
Feb 7th 2018, 14:31 |
o0h |
@admad thanks! i wonder why it is in there, and feel it’s better to remove the annotation from ConnectionInterface.. ;( Can I send patch to fix it? |
# |
Feb 7th 2018, 14:29 |
eax |
admad: I've tried changing what you pointed out, to ['json'], false, and even removing it, sadly to no avail :/ |
# |
Feb 7th 2018, 14:15 |
admad |
found it https://github.com/cakephp/cakephp/blob/master/src/Database/Driver.php#L288 |
# |
Feb 7th 2018, 14:15 |
admad |
@o0h yeah that `@method` annotation is strange. Must have been added to make phpstan happy but i don't see where that method would have been called on a connection instance |
# |
Feb 7th 2018, 14:13 |
admad |
@alysson-azevedo you can make a PR to make the excel lib it uses configurable. Also you when using composer require in your app you can tell composer to use the specific branch from your repo |
# |
Feb 7th 2018, 14:09 |
eax |
alysson-azevedo: I am using CRUD's API Listener, which means that _serialize is automatically handled :) |
# |
Feb 7th 2018, 14:08 |
alysson-azevedo |
and here i need to set _serialize to true (or list each entry i want) |
# |
Feb 7th 2018, 14:07 |
alysson-azevedo |
yep, i also use only json response |
# |
Feb 7th 2018, 14:06 |
eax |
I am getting a fully fledged json response, but the data key doesn't have any values |
# |
Feb 7th 2018, 14:03 |
eax |
alysson-azevedo: That is already handled by the API listener :) |
# |
Feb 7th 2018, 14:03 |
alysson-azevedo |
and after that, checkout documentation about this _serialize thing |
# |
Feb 7th 2018, 14:02 |
alysson-azevedo |
yes. try set $this->set('_serialize', true); on your beforeRender function |
# |
Feb 7th 2018, 14:00 |
eax |
admad: because it's empty? |
# |
Feb 7th 2018, 13:59 |
admad |
https://gist.github.com/eaxexe/b81d57a63dc1727eb78347c6b5f95daa#file-allaction-php-L30 that's why |
# |
Feb 7th 2018, 13:58 |
eax |
And the final output, doesn't have anything in 'data' (even if I set data in $subject) |
# |
Feb 7th 2018, 13:57 |
eax |
I think I forgot an important fact: I am using the ApiListener to output to JSON :) |
# |
Feb 7th 2018, 13:57 |
eax |
alysson-azevedo: Indeed it is! |
# |
Feb 7th 2018, 13:56 |
alysson-azevedo |
yep. your data probably is on $subject->entities |
# |
Feb 7th 2018, 13:55 |
admad |
crud actions are supposed to render page or do something and redirect like normal action, not return data :slightly_smiling_face: |
# |
Feb 7th 2018, 13:55 |
alysson-azevedo |
you mean on your beforeRender callback, the $subject variable is null? |
# |
Feb 7th 2018, 13:53 |
eax |
Can someone tell me why my Custom Action in CRUD (Cake3) : https://gist.github.com/eaxexe/b81d57a63dc1727eb78347c6b5f95daa, doesn't return any data? :) Thanks! |
# |
Feb 7th 2018, 13:52 |
alysson-azevedo |
I wonder if there's a way to configure his plugin to use another Excel writer |
# |
Feb 7th 2018, 13:51 |
alysson-azevedo |
on that note, "my" plugin is basically a copy of https://github.com/dakota/CakeExcel, but using mk-j/PHP_XLSXWriter instead that PHPOffice/PHPExcel |
# |
Feb 7th 2018, 13:49 |
alysson-azevedo |
i see. thanks |
# |
Feb 7th 2018, 13:48 |
admad |
otherwise having /plugins/myPlugin/composer.json is useless. Add those deps directly to app's composer.json |
# |
Feb 7th 2018, 13:47 |
admad |
your plugin needs to be submitted to packagist and added as dependency to app through `composer require` only then it's dependencies would also be installed |
# |
Feb 7th 2018, 13:22 |
alysson-azevedo |
do i need to run composer install from my plugin dir? |
# |
Feb 7th 2018, 13:21 |
alysson-azevedo |
Hi guys, when i run `composer update` from my project's root dir, why it doesn't install the dependences declared on my /plugins/myPlugin/composer.json? |
# |
Feb 7th 2018, 13:19 |
ksc |
Okay thanks alot! |
# |
Feb 7th 2018, 13:14 |
eax |
* Which means I now actually get a response, but no data :P |
# |
Feb 7th 2018, 13:14 |
slackebot |
Action: eax Turns out I was missing a: $this->_trigger('beforeRender', $subject); ! Which means I now actually |
# |
Feb 7th 2018, 12:53 |
eax |
Hey Folks - I am trying to make a custom action in CRUD in Cake3, but when I run it, all I get back is 'null'. Here's my code: https://gist.github.com/eaxexe/b81d57a63dc1727eb78347c6b5f95daa - Can anyone see anything wrong? Or know other reasons why it simply returns null? _get is run correctly, and if I check the $entities variable before it returns, it returns correct data |
# |
Feb 7th 2018, 12:49 |
steinkel |
pass the user role to a custom finder in options and let the model handle the business logic |