I have an project that is used by many users and it's written in Codeigniter. I'm very happy with my application but I'm getting lost with Codeigniter because of the functionality of the framework and my application is getting too big for Codeigniter (that is what I think).
I want to go from Codeigniter to Zend, but the application is too big to begin all over again because there is still more functionality to come.
I don't know if someone has experienced or tried it, but does anybody know if it is possible to integrate Codeigniter into Zend as an module and migrate in steps to the Zend Framework 2?
Sorry for my bad english by the way :-)
Having experience with small and medium-scale projects with both CodeIgniter (CI) and Zend Framework (ZF), I can tell you that using one framework over the other will not solve any problem you might be having.
If you are looking for the added functionality provided by the ZF components, such as a ready-made class for Date or the Form verification class, know that you can use ZF components in Code Igniter. You will need to create a special class in CI that will jumpstart the ZF class autoloader. From there you can simply include ZF classes and use them as if you were inside a ZF application.
See http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/ and http://fr.slideshare.net/samsonasik/codeigniter-using-third-party-components-zend-framework-components for more details.
"Integrate" means you want to put your app running on CodeIgniter withing ZendFramework. So basically you changed nothing and there's no much sense of doing so.
You perhaps could consider porting your app from CI to ZF, but that will require rewriting of your code. But I'd first try to find out what the bottleneck in your app really is and ensure that you will benefit from the switch
Related
I've recently started work at a new company, and was initially assigned to help the web development team.
To my horror, their template application they use to set up every single one of the projects they do, is completely procedural.
I am very eager to swap it over to OOP, but before I do that I need to actually understand how to create a project.
The initial work is there - there's an index.php that swallows all calls made to the site/web application.
What I need is a tutorial on how to set up proper routing so that I can look at a URL and go "call this function in this controller" instead of including a bunch of PHP files to get the job done.
Could someone please point me in the right direction?
I was in the same situation and this course helps me a lot to learn more about MVC and Routing in PHP. As #Armin said you can use Slim Framework or phroute .In the other hand, you can use Laravel framework to take care not only routing but also all the other challenges as a PHP developer you might have in the future
It sounds like they don't use any well known framework. They probably also don't want to use one. I think the best solution in this case would be some routing library. You could use the Slim Framework. You will understand everything you need to understand in about 30 minutes. It's very easy to setup and easy to extend.
You should not try to write your own routing library, it'll become quickly a quite complex thing. You will just reinvent the wheel and loose time.
I also would recommend the Slim Framework. I've spent way too much time trying to roll my own framework with routing but the maintenance and updating on my own framework got it the way of actual projects.
Slim is extremely easy to understand and offers a lot of flexibility to mold your own type of application. Between the routing, middleware, containers, and using the Eloquent DB ORM it has plenty to offer.
As others mentioned before, don't reinvent the wheel. There are plenty of tools out there you can lean on that allows you to focus on the actual project.
I think that Create your own PHP Framework from Symfony documentation is the thing you are looking for. You shouldn't be worried about the title, it's not only about creating frameworks. It shows you how to start using Symfony components in plain PHP application and eventually create your own framework.
But creating framework part is not the most important one. Understanding how to use object-oriented components in your code is the key part.
Of course, one of the components is routing. It's use is described in first chapters: Introduction, The HttpFoundation Component, The Front Controller, The Routing Component, Templating (don't skip this one!). But I recommend continuing to the end, it's easy to read and very interesting article. Even if you don't want to use Symfony (or it's components) this article will help you understand how to use any modern PHP components.
I built a PHP web application and was told I now have to add a PHP framework, Zend Framework, to the project. I have no idea where to start or how to add it into my project. I've tried looking at the user guide which started to make less sense the further I went into it. And tried looking at tutorials which all show how to create the skeleton project but not add it into your own project.
Would a programmer normally create the framework and add the existing code into it?
Or
Would a programmer add the folders into the existing application and mold it to it's desired MVC pattern?
I'm using the Cloud 9 IDE for this. Hope I can get some insight as to what would be best and get some insight in how it should be done. Thanks for any help!
I am now working in a team to build a website using php. Told that Zend framework can be fairly convenient, I hope to use it to write the pages. However, some of the members in the team did not use the framework in their previous works. I do not know whether there will be any possible problems if their works are used together with mine? So I wonder whether it is possible for us to use Zend frameworks for part of the website while other members of the team do not use this framework to build the rest of the website? Thank you.
i not really sure to undersand your question
but it's look complicated to use ZF for a part of the site, and PHP for the other. However, it's possible. You can, with a .htaccess say that an URL is not define by ZF (i ever used it for a blog attached on a ZF site)
Don't hesitate to comment for any other answer
It depends on how you are splitting up the work. Zend Framework is modular so you are not tied into using the whole framework. You can just select the components you need. I would advise that you use one framework for your application startup and routing at least. Merging these part would be a hassle to maintain imo.
I've read many tutorials about MVC method ... I am now about to start an e-commerce application with PHP... So I'm confused about from where to start.(What's the best directory hierarchy ,the files, the templates etc)
Knowing that I will create admin pages(in a subdirectory with MVC), and website pages ... all I want is to know how to organize all this.
I've already created PHP websites (I am good in PHP and OOP). But not with MVC.
Thank you
As mentioned by #Daniel A. White, there already exists a lot of PHP MVC frameworks. Have a look at:
DooPHP (Personally love this one!)
CakePHP
Symfony (updated for version 2)
Zend
CodeIgniter
There are a number of different open source MVC frameworks for PHP such as CakePHP that should get you inspiration.
I'd start with a PHP framework like CodeIgniter because it's already packaged with a simple, effective and easy-to-use MVC structure that'll get you up to stratch with the logic necessary to start programming this type of web app. They also have a good user guide and support base - so help's never that far away if you run into trouble.
I'm embarking on a very big exercise to build a CMS in php. It's actually my attempt to learn PHP in a fun (and hardcore) way coming from a Java background. Java is all object oriented so oop is in my blood, but I'm finding that OOP hasn't made it yet to PHP. Most PHP is still being written today the old way without the new concepts.
I'm trying to find an example PHP CMS that's written as object oriented. I hear Xoops is. Any others you know of? or any OOP libraries in general that you know of that could help me in a CMS project.
I would suggest symfony framework as it is well documented and functional framework that helped building many web applications.
http://www.symfony-project.org/
PHP5 is pretty OOP. Look for CMSes and frameworks that only work on PHP5. For example, Kohana
Concrete5 is a pretty complex OOP based CMS. Might be a harsh start but I've learned a lot by working with it.
again, +1 for symfony, but this is a large project and getting to know symfony will consume most of your time, yet if you want to dive in, its documentation is really great.
since you are trying to build your own CMS, get started with easy to grasp frameworks and build upon them. Don't waste your time on everything that has been already done. I recommend you Codeigniter MVC Framework http://codeigniter.com and for CMS, PyroCMS http://pyrocms.com which is built upon codeigniter is cool. Codeigniter is really easy to get along, and documentation is very neat and clean.
Further, if you like to start with a simple php framework, here's what Tyrehall has done, http://github.com/tylerhall/simple-php-framework . This project can act as a base for your CMS
No one seems to have mentioned Kohana the PHP 5 only framework.
Kohana has a pretty active and very helpful community to back it up (#kohana on freenode in particular).
edit: Upon closer inspection I see someone has already mentioned Kohana.
what you will notice is that what is more important to most cms (and framework) developers is MVC pattern implementation. Most MVC implementations in php do in fact use oop practices (some stricter than others)
+1 for symfony, and another I'd like to recommend is Kohana (built on CodeIgniter)
Also have a look at their forums, as both already have a cms or 10 built using these frameworks.
Using these frameworks brings you about 60% there, as a lot of the rudimentary tasks are taken care of.
edit
also remebered this one: fatfree framework it's quite lightweight: http://fatfree.sourceforge.net/
Have a look at Phundament 3.
Phundament 3 is an application foundation built upon a set if independent Yii modules and extensions such as user, rights, yiiext, gtc, ckeditor, jquery-file-upload, p3widgets and p3media.
The combination of p3widgets and p3media provides basic content management system (CMS) features, like dynamic widget creation and file management.
Combined in ckeditor, p3media acts as a ckfinder plugin which gives you the full power of HTML and media files for content creation via p3widgets.
It comes with a very minimalistic setup which integrates perfectly into an Yii web application skeletion and installs with one single command.
as some folks suggested here, you should start with Codeigniter because it's really easy to dive in. Its documentation is very well structured and easy to read. But I think Codeigniter seems to be very old now.
What I really recommend to you is Laravel. There's another Framework you should look into, that's FuelPHP. But for me, Laravel has absolutely changed to way I'm writing my PHP code. It is the best framework I've ever seen in my life. It's so elegant that you will instantly fall in love with.
If Laravel suits you, I recommend you to follow this online course by Jeffrey Way # Tutsplus.com. You will love it!
Good luck :)
Have you seen CakePHP?
http://cakephp.org/
Its a MVC framework for PHP. Its pretty robust and can be used in a fully object oriented manner.