Components
| JPromoter |
| JContentSubscription |
| JDefender |
| JUser |
Tutorials
Development tips and tricks
Best development practice
| Best development practice |
| Thursday, 18 January 2007 | |
Extending core classesI have found it absolutely useful to extend any API class you ever use. For example JFile, JText, JRequest, JWatever. I usually create special file that I load in second line in admin.mycomponent.com. Why? Because later you probably will need to do some extra operations. And yet you do not need to declare every function you use. Just extend the class. My file looks like this:
The above example shows class that extends JFile core joomla class. See, now you can set default upload directory or check for maximum upload size that can be part of component public configuration. You can process file to check for viruses, create thumbnail if it is image or whatever. May be that is not best example for area of application but this is best practice for sure. See also how it is greatly applicable for automatic creating of language file during development or for example this.
Then to alert admin on errors just num your error more the 1000. More later hereComments (0)
![]() Write comment
|
|
| Last Updated ( Friday, 16 March 2007 ) |
| < Prev |
|---|


