codeigniter: admin/cms as separate project or part of the same - codeigniter

So I've built a front-end to a website in Codeigniter, it has public and members areas.
Now it's time to build the backend administration where staff can manage some content: http://mysite.com/admin
At first I was going to just create subfolders within my controllers, models,views and resources folders for 'admin'
I'm wondering if I should just be doing a separate installation of CI for the admin? the layouts are different, the auth is different, sure they will share the same MySQL database but the admin will have different models and controllers
Best approach?

This article by Phil will give you a better idea:
http://philsturgeon.co.uk/blog/2009/07/Create-an-Admin-panel-with-CodeIgniter

Related

is it important to use the same directories for views and models

is it important to use the same directories for views controllers and models or you can be free to create files inside created folders and refer to them when needed
in Laravel MVC
Check docs Directory Structure
The default Laravel application structure is intended to provide a great starting point for both large and small applications. But you are free to organize your application however you like. Laravel imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class.
I myself haven't tried doing my own folder structure. I would personally stick with the standard created by Laravel and follow that.

Laravel code organization

I want to organize Laravel code into below folder structure for the sake of easy maintenance and better grouping. I do not know whether I can do this in Laravel.
app
--order
----CustomerOrder.php
----CustomerOrderController.php
----CustomerOrderService.php
--purchasing
----PurchaseOrder.php
----PurchaseOrderController.php
----PurchaseOrderService.php
Can I modify configuration files to facilitate above hierarchy?
Laravel is a MVC-based framework. The controllers and models are placed in different folders as the documents instruct:
https://laravel.com/docs/master/structure
I suggest you organize and group your project folder structure according to Laravel document. The readability and maintenance will be much easier if everyone using the same folder structure in same framework rather than the customized structure.

Making codeigniter admin to rule them all

I want to make a codeigniter admin/cms to manage all my clients front ends, i want to separate the admin application in two folder, the generic folder, that all other will extend or use, and the client site admin, that i will make for the client needs.
Can it be done?
i recommend the WireDesigns HMVC - https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc
This will allow you to make 2 modules Front-End / Admin in each module it follows hte same rules of Controller / Model / View which you can build up each one independently but to work together.
Technically though you could just create 2 folders in your controllers folder called Frontend / Admin, and build your controllers right there.
but if you looking for cleaner ogranization, try the HMVC

How to create a seperate directory for admin controller in cakephp

I am new to cakephp development. I have create user controller to register, login & update own profile in the user table. I can access the user controller with http://local-host/my_project/user/login.
I have also a admin table in database so that admin can login and manage user in my project. I want to create a folder separate folder (ex: admin) in the controller directory so that i can access the controller files using http://local-host/my_project/admin/controller/login & http://local-host/my_project/admin/controller/manage.
You should have a look at 'prefix routing' in the manual, it seems that this is what you're looking for:
http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing
With prefix routing, you'll be able to add, for example, an action admin_overview() to your User controller which is then accessible via the URL /admin/users/overview. The 'admin' prefixed action will not overlap with non-admin actions (e.g. 'overview()'), which will be accessible via the 'regular' URL; /users/overview/
Of course, you can create separate admin controller(s) for this purpose, but you may need to create custom routes. For more advanced options regarding routing, it's worth your time to read the whole chapter (or, even better) read the whole cake cookbook, it's also available as eBook for offline reading;
http://book.cakephp.org/2.0/en/index.html
Another solution is to develop the 'admin' part of your application as a plugin. This will keep your frontend and backend controllers/models/views separated. As a bonus, the backend may can be re-used for other projects as well (depending on its design of course)
http://book.cakephp.org/2.0/en/plugins.html#creating-your-own-plugins

Codeigniter expressionEngine

I just started working with codeigniter and i found it easy to work with. I recently came across expressionEngine and seems like a great add-on for codeigniter. My questions is, after i install expressionEngine, will that change the way i work with codeigniter where code goes in controller and view in the view folder.
Apples and Oranges,
Codeigniter is a framework that allows you to create a Web Application like an admin system. The customer does not add any content or touch anything. You can add CMS functionality to your codeigniter Web Application however in this sense you are actually building your own CMS on top of your Web Application.
ExpressionEngine, built with codeigniter, is a CMS that allows clients to add content without actually giving them access to your HTML - That is not to say that you can't give them access but this would defeat the purpose of a CMS.
Because expressionEngine is built on top of codeigniter it is possible to access it's functionality (I've seen posts on this but haven't tried it yet myself).
I think you would use the two together if you had a Web Application with a Website around it. In this way the client would be able to add content to the website and even some of the Application information areas but you would use Codeigniter to build the Web Application's functionality.
I don't think it would be a waste of a week to get into expressionEngine. LevelUpTuts has some great video tutes on expressionEngine 2 and try Nettuts+ CodeIgniter from Scratch for, suprisingly, codeigniter.
(For those who are new to CMS) The general process of development is:
- Translate your website design to HTML/CMS/jQuery
- Translate your HTML to expresionEngine Templates
- Define your Channels which your clients will add content to
- Embed those Channels into your templates to display that content dynamically
- In administration, assign permissions to who can add content to which channels for your clients
It will start to make sense once you try it.
You can't layer ExpressionEngine on top of CodeIgniter since CodeIgniter is extracted from ExpressionEngine. It's EE all the way, or use CodeIgniter to build your own thing.
ExpressionEngine supports PHP code inside it's templates if that's what your asking.
EE(2.0) is a CMS built on the CI2.0 framework.
If you are familiar with CI you will be able to hack, modify and extend EE with ease, as well as develop your own plugins etc.
You can of course, have an EE installation and a CI installation on the same server, but the two do not interact directly - CI is a framework, EE is a CMS.
Not sure I would call EE an "add-on"...
EE is it's own standalone Content Management System. Generally EE and CI are not meant to be mixed. While EE is built on CI, it is not meant to be extended/changed etc... They (Ellislab) will tell you, If EE doesn't fulfill your requirements, then you need to use CI exclusively.
Plus, a 300$ license is pretty expensive for something that you view as an "add-on".
I would reccomend looking into PyroCMS, which is also a free (beer and speech) CMS built on CI that directly allows for "Module" development which is straight codeigniter development with a few added meta/installation files that would allow you to build the extra functionality you need within the Codeigniter structure.
There are four files for expression engine.
For Example i have module named "Products"
1)mcp.products for admin end or admin control panel just admin controller in pyrocms
2)mod.products front end code is placed here 3)tab.products tabs are here 4)upd.products installation code. There are views in "views" folder and model is in "model" folder in our case "products_model". Just copy your controllers methods and paste them in mcp.products.php on admin side. and copy your controllers methods and paste them in mod.products.php on front end side. in udp file place the table structure.and it will treat as you are in Pyrocms.

Resources