I have multiple(two) Codeigniter applications in one project. The directory structure looks like that:
applications
--application
--oglasnik
I want to use a helper from application in oglasnik.
$this->load->add_package_path(APPPATH."../application");
$this->load->helper("string_helper");
$this->load->remove_package_path();
This works fine, but i need this helper quite a lot in the application, so is it possible to set a helper from another application in autoload.
Create a relative soft symbolic link in
oglasnik/helpersnamedstring_helper.phpthat points to../../../application/helpers/string_helper.php. This way you can use the normal load method as PHP will think that file exists in the regular helper path, but it actually is the symbolic link pointing to the original one.See this on how to create a symbolic link.
(run this in
oglasnik/helpers)Example Command:
To test that link was created correctly, opening the symbolic link
string_helper.phpcreated inoglasnik/helpersshould open the filestring_helper.phplocated inapplication/helpers