Welcome Guest, Not a member yet? Register   Sign In
HMVC Library Loading
#1

[eluser]dag[/eluser]
Hi all,

i have a problem loading a module library from within a non-module controller.
my application looks like this

-core
-controllers
home.php

-misc
-modules
-customers
-controllers
-libraries
Customers_lib.php (contains a class Customers_lib )

when i try to load the customers library from within the home controller

Code:
$this->load->library('customers/customers_lib);

i recieve the following error

"Unable to load the requested class: customers_lib"

anyone any hints?

thank in advance

dag
#2

[eluser]umefarooq[/eluser]
i prefer you to put your library in application library folder or try to rename the your php file to lower case not like Customers_lib.php rename it to customers_lib.php small letter file name.
#3

[eluser]dag[/eluser]
thanks for your quick reply,

but renaming did not solve the problem.
and putting the library file to application/libraries is not really an alternative.

any other ideas?

Code:
$this->load->module('customers/controllername')
works without any problems

whereas
Code:
load->model
and
Code:
load->library
do not.

dag
#4

[eluser]umefarooq[/eluser]
are you really using HMVC library for your application than try one thing and it will work with you in your application folder create one folder name module and put and inside put your customer folder like this

application
- modules
-customer
-controllers -model -view

and put your controller, model and view folder in customer folder and use application library folder to put your custom library files. it will work and its working with me same.
#5

[eluser]dag[/eluser]
ok i think you are right. i read the wiki post for hmvc again and i guess i misunderstood something.
i thought it should be possible to load models/libraries from modules directories but it seems as it is not.

guess i have to think for another possibility to load some functions from a module without loading the module itself.

thank you




Theme © iAndrew 2016 - Forum software by © MyBB