First of all, I want to describe my project architecture:
My project uses jqGrid.
Controllers only define the Grid.
Then Models retrieve the Data for the Grid.
Models are used to Add/Edit/Delete Records.
Views are used to show the page.
Consider, I have 10 different kinds of customers for my project. My project is a hosted solution which serves my all 10 customers from a single source. Among them, eight needs the exact same as I created. Only two are different than the common.
For example, imagine that I want to show a product list. As my project is a hosted solution I can't change the menu by which I can change the controller for the said two customers.
To solve the problem, I want to implement plugin system like Joomla.
How can I do that in CodeIgniter?
Edit
I am using CI 1.7.2.
Maybe it will help you:
There is module solution for Codeigniter HMVC module . It gives you way to divide application logic into modules with their own MVC structure (each module will have it's own model\view\controller).
After installing this module into CI you'll be able to call another module from main app's controller (or view or model) like that:
<?php echo modules::run('module/controller/method', $param, $...); ?>
So I think you can use modules functionality provided by this extension to build per customer modules structure based on customers roles.
Related
Im completely new to Joomla development. I need to develop Joomla plugin that adds static javascript to the footer of all the pages of a Joomla site. Also, the plugin would need to save 2 fields in database, and access these fields on per page basis. Also, Admin panel is needed.
Now, my questoion is, where do i start? Joomla plugin development is a big task, so if I can get some pointers as to where to start, it would be very supporting.
Im not asking for direct code, but just the right direction to start.
Thanx in advance....
Joomla has three types of extensions (what you refered to as plugin): components, modules and plugins, where each has a different purpose.
If you need to add javascript to all pages, the best place is your template. If you don't have access to template, just building an extension, then you have to create a content plugin.
If you need to create extension with admin panel which also works with database, you need to create a component. The best place to get started is tutorial Developing a MVC component for Joomla 2.5
I am building a shopping cart system as part of a CodeIgniter 2 site that uses HMVC.
Instead of having one big "cart" module I was hoping I could break up the module into sub modules.
E.g.
/modules/cart
/modules/cart/config
/modules/cart/controllers
/modules/cart/models
/modules/cart/views
/modules/cart/modules
/modules/cart/modules/categories
/modules/cart/modules/categories/config
/modules/cart/modules/categories/controllers
/modules/cart/modules/categories/models
/modules/cart/modules/categories/views
/modules/cart/modules/products
/modules/cart/modules/products/config
/modules/cart/modules/products/controllers
/modules/cart/modules/products/models
/modules/cart/modules/products/views
Is it possible to do this or something similar?
i worked on codeigniter before 4-5 months. As per as i remember in application folder we can make modules.
Under modules package, we can create the package with the name which we required. We may call it as cart.
Under cart, as per i know, we can not create modules under it. But like each and every folder we can create the particular sub folders and this can solve the your problem as well.
Your folder structure will be like as follows
/modules/cart
/modules/cart/config
/modules/cart/controllers
/modules/cart/controllers/categories
/modules/cart/controllers/product
/modules/cart/models
/modules/cart/models/categories
/modules/cart/models/product
/modules/cart/views
/modules/cart/views/categories
/modules/cart/views/product
i may we wrong. On this link https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home described very well.
I'm just starting out on a component for Joomla. I can't figure out how to add an entry in the dB so I can access the component.
I looked at the dB table for components, but some of the columns seem to require some specific info.
This is NOT a finished component, but a new one I want to build.
I am using Joomla 1.7.
take care,
lee
As Jogesh_p suggested, the easy way is to create an xml file like this
http://docs.joomla.org/Components:xml_installfile
If you are just starting out with Joomla development then take a look at the Hello World tutorial.
http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!2.5_-_Part_01
Another option to create a Joomla component quickly is to use EasyCreator, which will create the basic parts of the extension that you can then build on.
I'm developing a custom joomla component and have CRUD requirements on my database tables. In most of the examples i've seen, the default and admin pacakges both have their own model folders, and their seems to be a large amount of duplication. Is there a simple stragety to define the models and tables once within the admin section and then allow the default component to reuse the logic?
Hi you can reuse admin models by adding this into your front end component's main file:
$controller->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models');
You can reuse tables by adding this into your front end component's main file:
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
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.