Welcome Guest, Not a member yet? Register   Sign In
Making Helpers more Helpful
#1

[eluser]Unknown[/eluser]
Wouldn't it be better if Helpers were abstract classes with static methods, rather than php scripts with random floating methods?

Once you loaded a helper, like so:
Code:
$this->load->helper('my_helper')

It could then be accessed like so:
Code:
my_helper::function_name(args)

It would make code more readable, and further CI's commitment to OO PHP.

(Yes I know this wouldn't run on PHP4).
#2

[eluser]adamp1[/eluser]
I suppose then it turns into what CI defines as a library. One reason I would like this is so I can better Unit Test my code, as you may/may not know functions which have already been loaded are impossible to mock.




Theme © iAndrew 2016 - Forum software by © MyBB