0

I'm building my own base to use on multiple sites that I will be building. And I've made a package for that. But I want to extend the CI helpers in that package (not in the app) - helpers such as url_helper, html_helper etc.

I've put a config folder (although I don't really understant what it does) in the package folder and a config file in it (so structure is packages/app_package/config/config.php).

I've put the $config['subclass_prefix'] = 'app_'; (different from the application one preferably) and still not loading the helpers app_url_helper etc

Did anybody do that?

Ciprian Mocanu
  • 2,166
  • 3
  • 25
  • 44

1 Answers1

-1

Have a look at CodeIgniter Helpers. Specifically the section labelled "Extending" Helpers.

I'm not quite sure what you mean by:

I've put a config folder (although I don't really understant what it does) in the package folder and a config file in it (so structure is packages/app_package/config/config.php).

You're not required to 'create' any config folders or files at all. The config file already exists and is located in application/config/config.php of your CodeIgniter project. The Class Extension Prefix is located ~ line 110 (version dependent). Set it to _app

Now create app_url_helper.php and app_html_helper.php in application/helpers and away you go.

Jordan Arsenault
  • 7,100
  • 8
  • 53
  • 96