Welcome Guest, Not a member yet? Register   Sign In
Name folder name of controllers/models/views in one single variable to make it easy to put them together.
#1

[eluser]Unknown[/eluser]
First of all, sorry for my poor English.

As a normal developer, One thing I frequently do, when developing, is searching files in application/controllers with my mouse pointer in the navigation bar in the IDE. as well as models and views. We know that there are more than ten folders in the application folder, and there were loooong distance between these three folders.(I know in JetBrains PhpStorm Ctrl+Shift+n can help me find files with names quickly and easily. but...) It wastes my time and makes me crazy.

So someday, an idea came to me: Why not RENAME the three folders with a prefix like 'mvc_' so that they will looks like this:
Code:
application/
    cache
    config
    core
    errors
    helpers
    hooks
    language
    libraries
    logs
    mvc_controllers
    mvc_models
    mvc_views
    third_party

I renamed the three folders, then tried to extend, in application, some system files like 'Loader' and 'CodeIgniter'. I opened 'CodeIgniter.php', then searched 'controllers/', and was disappointed with below:
Code:
Line 245:  if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php'))
    Line 250:  include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php');
    Line 279:              if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
    Line 284:              include_once(APPPATH.'controllers/'.$class.'.php');
    Line 341:                  if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
    Line 346:                  include_once(APPPATH.'controllers/'.$class.'.php');
And so did in some other files and 'models' and 'views'.

Now comes the point: Will we put the three folders' name in single variables in configuration files or somewhere else in the comming versions of ci? thank you.
#2

[eluser]TWP Marketing[/eluser]
Seems like this is a problem with IDE configuration, rather than CI naming convention. In the IDE, I sort/display my files/folders by date of change, which keeps the most frequently used files/folders at the top of my IDE list, which is what I think you want.
#3

[eluser]Glazz[/eluser]
Yes i'm with TWP Marketing but i know what you mean about that code, CodeIgniter can and SHOULD be improved, but oh well is what we have, deal with it =P
#4

[eluser]Dan Storm[/eluser]
It's difficult to see why this should be done - for several reasons.

Applying a prefix like mvc_ would only solicit debate and arguing what a better/worse alternative would be.

Enabling a configuration setting to manage the prefix, so that anyone can have any prefix they want, makes the possibility redundant as most wouldn't change this anyways, since most developers can comprehend that Models is in the model folder, views in the views folder and lastly, controllers in the controllers folder.

Documentation will be a bitch, since anyone could prefix the MVC folders with any name they want. And handing over such projects, kind of works away from the purpose of using well-documented frameworks who works with doing things in a documented way.

I could go on, but that would force me to do what I initially said this would do; solicit debate and arguing.




Theme © iAndrew 2016 - Forum software by © MyBB