Module Separation - php

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.

Related

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.

How to separate admin files and folders from public files and folders with Zend Framework 2?

i'm new in zend framework 2
i want to write a simple cms using zend framework2, but in start i want to separate the admin modules(files and folders) from the public.
i was built a simple cms before with this strategy
-public
-admin
index.php
-other folders related to admin
index.php
about.php
-other folder and files related to public view
can anyone give me a simple Cms building with Zend framework 2 or explain for me what to do?
sorry for my bad English
thanks
A ZF2 module can already contain its own routes, controllers, views, and public resources (the latter via the zf2-assetic-module). A single ZF2 app with two self-developed modules - one for the front-end and one for the admin back-end - should satisfy your separation criteria.
Note that you would typically still use a single public/index.php with a single .htaccess routing all non-resource (img, css, js, etc) requests to that index.php file.
Sounds to me like a deeper understanding of how ZF2 works would address most of your questions.

Converting an MVC app to HMVC in CodeIgniter

I have an App in CodeIgniter built using the regular MVC pattern. If I want to switch to HMVC then I have to move all Models,Views and Controllers to the modules folder? I don't understand if in HMVC everything is a module or both Modules and the old MVC structure can coexist.
H in HMVC stands for hierarchical, the files in your normal controllers,vews and models folders are on top of the hierarchy. This means that you can still use or old controllers,models,views folders. These folders will then be accessible by all modules in your system.

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

Sharing controllers, models and views between separate projects in CodeIgniter

Kohana, due to cascading file system and modules, allows to share code in common projects, that contains controllers, views and models directories. How can I do it in codeigniter? I want to create sites, that will share some code (admin area views, some models). That is easy in Kohana, we just have to add another directory for Kohana::find_file().
I think this is a duplication of:
Codeigniter Shared Resources - Opinions Wanted
And
How do I load a view from a specific (shared) path in CodeIgniter?
I'm more experienced in Kohana than CI but if I'm right there is a HMVC module in CodeIgniter. You could see if you are able to request a external page like you can with the HMVC of kohana.
If I may ask. why do you use codeigniter when you know kohana does the job better?

Categories