Welcome Guest, Not a member yet? Register   Sign In
My own function classes
#1

[eluser]bastones[/eluser]
Hi,

I'd want to create multiple function classes for various common tasks that'll be in my application, and I presume there'll be various classes for different category of functions. Obviously PHP only allows you to extend one subclass in any superclass so I'm unsure how I'd go about this easily when I'll have to extend the Controller class. I do have one good solution by making a base class which has the most common functions and that class extending the Controller, and my controller class extending the base class.

Just wondering my base class will be in the controllers directory so will I be able to extend that class straight away without needing to include the separate file.

Cheers,
bastones.
#2

[eluser]richthegeek[/eluser]
It sounds like you need to use a Library or a Model, depending on how specific these function groups are.
#3

[eluser]Mackstar[/eluser]
If the functions will be responsible for data based objects put it in the model, if it will be an action based object create a library...

Also quick functions to be pulled in generally would go in the helpers section.

Cheers

Richard




Theme © iAndrew 2016 - Forum software by © MyBB