Welcome Guest, Not a member yet? Register   Sign In
Add initController section in spark make:controller
#1

(This post was last modified: 02-25-2025, 10:36 PM by Corsari.)

Hello, in my personal opinion
It would be logical for
Code:
php spark make:controller

to include the

Code:
initController()

skeleton as part of its default template, similar to how it handles models with make:model . 

The parallel with

Code:
make:model

is fitting: when you generate a model with PHP Spark, it comes populated with various default settings that you can adapt or remove based on your needs. Applying the same approach to controllers would make sense.
Considering that:
  • Most controllers end up needing at least one model
  • The implementation of initController() follows a fairly standard pattern
  • It's easier to remove unnecessary code than to remember to add important code
This would help developers adopt the best practices suggested by the framework.

Regards
R.
Reply


Messages In This Thread
Add initController section in spark make:controller - by Corsari - 02-25-2025, 10:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB