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
#2

Can you create a PR for improvement?
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply
#3

Hello
Sorry
What is a PR ?
Thank you for clarifying
Reply
#4

(This post was last modified: 02-26-2025, 03:56 AM by JustJohnQ.)

A PR is a pull request on github and is used to request a feature or improvement to Codeigniter.
See this site: https://github.com/codeigniter4/CodeIgniter4/pulls
Reply
#5

(This post was last modified: 02-26-2025, 04:42 AM by Corsari.)


I have written here , given the name of the forum section

but , sure I'll write it in github too

--------

Sorry tried , looks a mess

Can you kindly explain what to set to get the button for pulling a request?

Thank you
Reply
#6

Read https://github.com/codeigniter4/CodeIgni...ntributing
Your bug report (issue) will probably be closed.
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB