How to convert php application to MVC using CodeIgniter ? |
[eluser]pedma[/eluser]
Hi, I'm new to CodeIgniter. I can't find any information about converting php application (authentication class, multilevel users, session/cache, smarty template, etc) to MVC - CodeIgniter. Is it possible ? Any idea how to do it ? Thank you very much in advance. Best Regards, - pedma -
[eluser]jakub[/eluser]
Of course it is possible, You would have to start and break your application into the 3 parts of MVC: Models (all your database calls, organize them properly) Views (The part where you stick your HTML / smarty template) Controllers (here you stick in your code that combines both model utilization + view output) Do some testing with CodeIgniter first, to get a feel of how things work, I don't think anyone expects you to perfectly port 1 application into another without any issues along the way. Also you could save time by utilizing available authentication frameworks, and things like session/cache that are built into CI)
[eluser]pedma[/eluser]
[quote author="jakub" date="1296686880"]Of course it is possible, You would have to start and break your application into the 3 parts of MVC: Models (all your database calls, organize them properly) Views (The part where you stick your HTML / smarty template) Controllers (here you stick in your code that combines both model utilization + view output) Do some testing with CodeIgniter first, to get a feel of how things work, I don't think anyone expects you to perfectly port 1 application into another without any issues along the way. Also you could save time by utilizing available authentication frameworks, and things like session/cache that are built into CI)[/quote] Hi Jakub, Thank you very much for your informations. Do you mean that CI has features like authentication & session/cache handling, so I can use it for my application instead of using the existing one? At my application, there are multilevel user group like : superadministrator, manager, accounting, sales, etc. Each user of the same group can has the same setting of allow/deny to a module (but can also different). Example: User of group superadministrator can do anything, including application setting (time, price, etc), application/database backup, change password of other users, etc. User of Manager group can see accounting data (AR, AP, Provit, etc), can also see data of user from sales group, BUT can not change the password of other user. User from group accounting just can see accounting data. User from group sales just can see the sales data. Has CI the features to control this, or I must create it inside CI (may be porting of old scripts to match the CI framework) ? Thank you. - pedma -
[eluser]jakub[/eluser]
[quote author="pedma" date="1296772272"][quote author="jakub" date="1296686880"]Of course it is possible, You would have to start and break your application into the 3 parts of MVC: Models (all your database calls, organize them properly) Views (The part where you stick your HTML / smarty template) Controllers (here you stick in your code that combines both model utilization + view output) Do some testing with CodeIgniter first, to get a feel of how things work, I don't think anyone expects you to perfectly port 1 application into another without any issues along the way. Also you could save time by utilizing available authentication frameworks, and things like session/cache that are built into CI)[/quote] Hi Jakub, Thank you very much for your informations. Do you mean that CI has features like authentication & session/cache handling, so I can use it for my application instead of using the existing one? At my application, there are multilevel user group like : superadministrator, manager, accounting, sales, etc. Each user of the same group can has the same setting of allow/deny to a module (but can also different). Example: User of group superadministrator can do anything, including application setting (time, price, etc), application/database backup, change password of other users, etc. User of Manager group can see accounting data (AR, AP, Provit, etc), can also see data of user from sales group, BUT can not change the password of other user. User from group accounting just can see accounting data. User from group sales just can see the sales data. Has CI the features to control this, or I must create it inside CI (may be porting of old scripts to match the CI framework) ? Thank you. - pedma -[/quote] Pedma, CI is a framework, it does NOT have a full user/role management system. However it does have caching and session tracking out of the box. Simply go through the user guide for answers, they are neatly organized in the top menu. You would certainly have to do modifications to your existing app to have those things working your way.
[eluser]pedma[/eluser]
Quote:Pedma, CI is a framework, it does NOT have a full user/role management system. However it does have caching and session tracking out of the box. Simply go through the user guide for answers, they are neatly organized in the top menu. You would certainly have to do modifications to your existing app to have those things working your way. Thanks Jakub. If CI doesn't have a full user/role management, but we can add/modify it to create our own role, isn't it ? Or can I use the ACL like : - http://mini-app.peccavi.com/ - http://bizwidgets.biz/ezauth/ - http://ellislab.com/forums/viewthread/60378/ - http://www.tastybytes.net/blog/simple-ac...odeigniter What do you think ? Thank you for your tips about user guide, I will see it. Thank you again Jakub. - pedma -
[eluser]Glazz[/eluser]
pedma, There are libraries for CI to do what you want, an example is Ion Auth http://ellislab.com/forums/viewthread/145263/ - G l a z z
[eluser]Vheissu[/eluser]
[quote author="Glazz" date="1296804318"]pedma, There are libraries for CI to do what you want, an example is Ion Auth http://ellislab.com/forums/viewthread/145263/ - G l a z z[/quote] Ion Auth is a group based auth library at present, not role or access control list based. ACL and Auth are two different things. Ion Auth is great for authentication, but not limiting access to specific controllers and methods based on an access list like ACL is.
[eluser]pedma[/eluser]
[quote author="Vheissu" date="1296814502"][quote author="Glazz" date="1296804318"]pedma, There are libraries for CI to do what you want, an example is Ion Auth http://ellislab.com/forums/viewthread/145263/ - G l a z z[/quote] Ion Auth is a group based auth library at present, not role or access control list based. ACL and Auth are two different things. Ion Auth is great for authentication, but not limiting access to specific controllers and methods based on an access list like ACL is.[/quote] Hi Glazz & Vheissu, Thank you very much for informations. I think Vheissu is right, I need an ACL for controlling permission to specific module for specific user/group. Have you any idea, which ACL is better for this application ? Thank you. - pedma -
[eluser]Vheissu[/eluser]
If you want the best of the best when it comes to ACL you currently can't beat Zend's ACL component. You can easily use Zend ACL components in Codeigniter, if you do a search here on the forums or Google for "zend codeigniter" or "codeigniter zend acl" without the quotes, you are bound to find what you need to get ACL integrated.
[eluser]pedma[/eluser]
[quote author="Vheissu" date="1296821970"]If you want the best of the best when it comes to ACL you currently can't beat Zend's ACL component. You can easily use Zend ACL components in Codeigniter, if you do a search here on the forums or Google for "zend codeigniter" or "codeigniter zend acl" without the quotes, you are bound to find what you need to get ACL integrated.[/quote] Hi Vheissu, Thank you very much for your information. I found this : http://www.mattstone.me/?p=3 and will have a try on it. Thanks again. Best Regards, - pedma - |
Welcome Guest, Not a member yet? Register Sign In |