codeigniter HMVC extension model organization - php

I am developing a portal and using codeigniter with HMVC extension. I have an "admin" module and a "yellowpages" module. Both these modules have a common model eg: "Category_model", and I use it to list down the categories both in the frontend(yellowpages) and backend(admin) module.
So my question is, can I place the model in the application/models directory and have it accessed by both the modules, or do I have to copy the model and place each copy inside /modules/admin/models and /modules/yellowpages/models

Resources may be cross loaded between
modules. ie:
$this->load->model(‘module/model’);
More info here and here

Related

Multiple Laravel websites, central codebase

I want to create a single Laravel installation that comprises the core functionality of the websites - for example content CRUD functions.
Then on top of this in separate folder on the server for each website have the public folder, css, images etc as well as overriding controllers, models and routes that can be used for specific features per site.
I have achieved the same previously using FuelPHP but have not been able to see where this would be setup in Laravel.
The kind of server folder structure I was anticipating is as below:
/Laravel Core Installation
/app
/vendor
storage
etc
/The first website
public
app (in here would be controllers and models that extend the controllers and models from the Laravel Core Installation folder)
config
etc
/The second website
public
app (in here would be controllers and models that extend the controllers and models from the Laravel Core Installation folder)
config
etc
What you are referring to is called multi tenancy.
Multitenancy refers to a software architecture in which a single instance of a software runs on a server and serves multiple tenants.
http://en.wikipedia.org/wiki/Multitenancy
There are several packages that assist with multi tenancy for Laravel, based on your needs. Some work with seperate database table prefixing, others with completely seperated databases and files.
Some of those packages:
Tenanti
AuraEQ
Hyn *
* Disclaimer; I wrote the last package from this list.

ZEND Framework folder/file structure

I'm trying to learn zend framework. I managed to install it on my localhost. However i'm having trouble understanding the folder structure? There are 5 main folders after installing the skeleton application - config, data, module, public and vendor.
I've seen some proposed folder structures online, but how to I go about it? Do I just create folders like views, controllers, models etc?
Thanks!
Vendor is where composer installs dependencies and libraries, config is where configuration lives, data is for cache etc, public is where your index.php and css/js/img assets are, you are really interested in module directory that contains application modules. For the start you only really need one module - Application, inside this directory you should have config dir that has module specific config, Module.php - module bootstrap file, view with templates structured per controller and src folder with your code. Inside your src file there is your Application module namespace directory that is placed in Application directory to mimic PSR-4 autoloader namespaces it can contain your application code in this example directory structure: Controller, Form, Model. Model can contain Service, Repository and Entity folders
If you just got started with ZF2 I suggest reading some documentation. Basic things like this can all be found in the documentation. For example here you find more about the folder structure.
I would also suggest taking a look at the ZF2 Skeleton application documentation/tutorial since this will help you understand the basics of a ZF2 application. Here an example on how to structure a new module. Building the album application yourself is a really nice way to get started.

Module Separation

I'm trying to figure out how I can work with module separation with codeigniter.
Lets say I have a news module where its inside of the application folder and inside the news module folder I have a controllers, models, views folders and files inside of those.
Do I need something additional to do this?
If you want to work with modules in codeigniter you can use Modular Extensions - HMVC which makes codeigniter modular. Here is the link https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home
I hope this helps.

Codeigniter HMVC modules structure

I'm working on a content management system in Codeigniter with the Datamapper and HMVC extension. My question is, how to handle submodules.
Example:
I want to create an User module which exists from Users, Usergroups, Rights and Modules. In codeigniter I have build it now like this:
Codeigniter root
application
modules
Users
models
user
right
usergroup
module
Is this the right way to fix it or am I doing it wrong?
You can't have submodules in HMVC without extending the MY_router class.
You have a nice tutorial here: HMVC: an Introduction and Application

Kohana 3 How to render module inside application

How to integrate module inside application? I have modules having two controllers and two respective views inside module. Now I want to integrate this module inside my application, so that views and actions can be handled by this module only.
Note that your Application, modules and System files may intersect. Use this picture to understand Kohana cascading filesystem:
So, if both application and your module have a views/welcome.php, application one will be found. When two modules have files with the same path, Kohana will select module with highest position in Kohana::modules() list.
Once you have created the module enable it in the application bootstrap.php then you should be able to visit [your-website]/modualController/action you might need to look at routes.
This is a great resource for modules and routing, and everything else Kohana http://kerkness.ca/wiki/doku.php

Categories