Workouts with Slim 3 - part 5- Action controllers



Since Apr 04, 2016 1 Posts

It is always a bad idea injecting the container instead of real controller dependencies. Isn't better injecting to the user controller only what it needs?

Injecting the container , tecnically makes your controller depending on the whole application. This makes mocking for tests a really hard task.

This is just a service locator pattern.

Since Jul 23, 2016 1 Posts

Thank you for the article. Where should we place our controller files?

zooboole Since Jan 22, 2015 112 Posts

Sure, something I need to review

Taslima Kabir Since May 26, 2017 2 Posts

Hi There, I am very new to php framework. Curretly I have learned very little of Slim Framework. I am kind of stuck to show some common widget/modules to every page. Suppose I have four Controllers for severing four different router point.One for blog. one for forum.... But I like to show new blog post on sidebar on every controllers like blog,forums. What's the best way to approach it.

Taslima Kabir Since May 26, 2017 2 Posts

Hi There, I am very new to php framework. Curretly I have learned very little of Slim Framework. I am kind of stuck to show some common widget/modules to every page. Suppose I have four Controllers for severing four different router point.One for blog. one for forum.... But I like to show new blog post on sidebar on every controllers like blog,forums. What's the best way to approach it.

Rahul Gupta Since May 25, 2018 1 Posts

Nice Article. However, I found $app->delete method actually weird here. 'delete' is referred to HTTP method here.However, In Order To delete a saved instance from the database or to process a saved object instance Delete command , we Often use either POST OR GET Method of HTTP. 'Delete' method was basically designed to delete a resource/file from the server. Please correct me, If I have missed something in understanding your view..