SprintPHP - CodeIgniter Supercharged |
I think there's two questions being asked here, really.
The first - can you load other models or libraries from modules? Absolutely. Just prefix the name of the library/model/helper, etc with the name of the module. So, if you have a module named Members, and you want to load the user_model from that, you could do it like: Code: $this->load->model('members/user_model'); And then use it like you normally would. Code: $this->user_model->find_all(); Secondly - you're wanting to create an admin area using all of your modules. This is pretty simple, actually. The first step is to create a Routed Area. In your routes file add this: Code: $routes->area('admin'); Check the docs for exact details, but this will basically allow any module to have a controller called Admin that will be routed at http://example.com/admin/{module}. This also means that you don't really need to call code form other modules very often at all. Especially if you combine it with View Callbacks. |
Welcome Guest, Not a member yet? Register Sign In |