# |
May 17th 2021, 16:01 |
ovidiu.marinoiu |
If I have my favicon in the webroot of the plugin, is there a way to link to it in meta()? |
# |
May 17th 2021, 15:57 |
ovidiu.marinoiu |
thanks! |
# |
May 17th 2021, 15:55 |
kevin.pfeifer |
https://book.cakephp.org/4/en/plugins.html#plugin-assets https://book.cakephp.org/4/en/deployment.html#improve-your-application-s-performance |
# |
May 17th 2021, 15:54 |
ovidiu.marinoiu |
Hi! How do I use assets from the webroot of a plugin? |
# |
May 17th 2021, 15:53 |
neon1024 |
I use an auth finder which returns loads of data and after login it’s all deeleted from the session :( |
# |
May 17th 2021, 15:49 |
neon1024 |
Strange when it denys a request it deletes the user data from the session |
# |
May 17th 2021, 15:48 |
neon1024 |
So this Request middleware, I need to add a specific allow for all the allowed methods in Authentication plugin as well? |
# |
May 17th 2021, 15:19 |
paolo.bragagni |
the docs is good enough |
# |
May 17th 2021, 15:19 |
paolo.bragagni |
;) |
# |
May 17th 2021, 15:19 |
paolo.bragagni |
YES!! |
# |
May 17th 2021, 15:19 |
kevin.pfeifer |
since I can definitely say the documentation can be quite confusing ,:) |
# |
May 17th 2021, 15:18 |
kevin.pfeifer |
i will definitely try to someday make a video about the whole cakephp framework and what i learned till now |
# |
May 17th 2021, 15:18 |
paolo.bragagni |
thanks you so much |
# |
May 17th 2021, 15:18 |
paolo.bragagni |
thanks I'll give it a try!!!! |
# |
May 17th 2021, 15:14 |
kevin.pfeifer |
and add the use statesments at the start of course ```use Cake\Event\EventInterface; use Cake\Event\EventManager;``` |
# |
May 17th 2021, 15:14 |
slackebot |
logout actions to the Users controller $view->set('actions', [ 'login', 'logout', 'index', 'view', 'add', 'edit', 'delete' ]); } } ); }``` |
# |
May 17th 2021, 15:14 |
kevin.pfeifer |
``` public function bootstrap(): void { if (PHP_SAPI === 'cli') { $this->bootstrapCli(); } } protected function bootstrapCli(): void { EventManager::instance()->on( 'Bake.beforeRender.Controller.controller', function (EventInterface $event) { $view = $event->getSubject(); if ($view->get('name') === 'Users') { // add the login and |
# |
May 17th 2021, 15:13 |
kevin.pfeifer |
and do the same as what your src/Application.php does where it checks for cli and adds that function https://github.com/cakephp/app/blob/master/src/Application.php#L51 |
# |
May 17th 2021, 15:12 |
paolo.bragagni |
can you make an example please? |
# |
May 17th 2021, 15:12 |
kevin.pfeifer |
so you can overwrite/extend the bootstrap function |
# |
May 17th 2021, 15:12 |
kevin.pfeifer |
you basically have the same functions in your src/plugin.php as in your src/Application.php https://book.cakephp.org/4/en/plugins.html#plugin-objects |
# |
May 17th 2021, 15:12 |
paolo.bragagni |
how about the views and model and policy .. etc?? |
# |
May 17th 2021, 15:11 |
paolo.bragagni |
and this solve the 'action' problem |
# |
May 17th 2021, 15:11 |
paolo.bragagni |
(how?) |
# |
May 17th 2021, 15:10 |
kevin.pfeifer |
instead of using the src/Application::bootstrapCli() can'ÄT you use the bootstrapCli function which is overwritten by the plugin? |
# |
May 17th 2021, 15:10 |
paolo.bragagni |
(at start) |
# |
May 17th 2021, 15:10 |
paolo.bragagni |
all my tables will have the same actions and views |
# |
May 17th 2021, 15:09 |
kevin.pfeifer |
unless all of your tables should have that extra action |
# |
May 17th 2021, 15:09 |
kevin.pfeifer |
well you need to specify the View inside that event as well so its basically pretty application specific |
# |
May 17th 2021, 15:08 |
paolo.bragagni |
I'll have to write many applications and I'd like that all of them have the same template, so with my actions, my views, my model etc |
# |
May 17th 2021, 15:08 |
kevin.pfeifer |
which I can't you in more detail |
# |
May 17th 2021, 15:08 |
kevin.pfeifer |
well basically you can do it anywhere before the Bake.initialize event is being called |
# |
May 17th 2021, 15:07 |
paolo.bragagni |
cant we do it inside the 'theme' plugin? |
# |
May 17th 2021, 15:07 |
paolo.bragagni |
I'd like to do it but not in my src/Application |
# |
May 17th 2021, 15:06 |
kevin.pfeifer |
have you added the event listener to add the additional action which should be baked? |
# |
May 17th 2021, 15:05 |
kevin.pfeifer |
so you already got a custom bake plugin working |
# |
May 17th 2021, 15:05 |
kevin.pfeifer |
well basically yes but probably i can help you in more detail :) |
# |
May 17th 2021, 15:05 |
paolo.bragagni |
no.. or.. yes.. you said to look at https://book.cakephp.org/bake/2/en/development.html#bake-events |
# |
May 17th 2021, 14:57 |
neon1024 |
https://book.cakephp.org/authorization/2/en/request-authorization-middleware.html |
# |
May 17th 2021, 14:57 |
neon1024 |
Ah found it |
# |
May 17th 2021, 14:57 |
kevin.pfeifer |
so my comment from yesterday (or whenever I tried to explain that) didn't help? |