Using Laravel bundle with CodeIgniter - php

I want to use Laravel Bootstrapper bundle http://bundles.laravel.com/bundle/bootstrapper with my CodeIgniter application.
How can i utilize autoloader functionality to use Bootstrapper bundle code in CodeIgniter in native PHP 5 fashion.
Button::make('Abc')->with_icon('ok');
Do you suggest to convert Bootstrapper bundle in CodeIgniter library or we can use it as it is.
I am using bootstrap for creating views, thus already including bootstrap specific css, js & images.
Please help, so that the bundle can be used with CodeIgniter

Why? It's not designed to work with CI, you'll probably have to mess about alot to get it working. See one of the many versions available for CI here https://github.com/vesparny/codeigniter-html5boilerplate-twitter-bootstrap.
Further more, I dont see any great advantage of having a bootstrap CI integration, if you do then go for it but I just use my own customised bootstrap and load it in as normal in template/view files. Works just fine and keeps all those UI/view bits and pieces separate for designers/Front-end coders who panic at the sight of php.
All this work trying to keep design, function and layout separate and people go to great effort to ruin it with something like this.

Related

Using Laravel with an existing website

I have an existing website running on PHP, MySQL CSS, JS and Ajax.
For future projects, I would like to use the Laravel framework to create new pages or functionality to the existing website... let's say a blog, for instance.
Is this possible?
Is the Laravel framework compatible with an existing website that is not set up using the MVC framework?
The reason is that I would like to make my work easier and more efficient and the use of a framework would be helpful.
Please let me know if you need any other info, I know the question is a little broad.
Thanks,
Justin
yes it's possible but of course maybe with difficulties.
you should put your web files in /views directory, convert your php files to controllers or library files and put your assets in /public directory.
then you can assign routes to your controller and call it form outside of the application.
main job is put your code into controller or libraries. is it possible to split your code into separate logical units? and extract model logic (as php mvc says) from your main code.
so if you have a clean code with good design and minimum dependencies you can think more about it. this could be a good challenge if you go through it cautiously. be careful to not fail and waste your time.

CodeIgniter + HTML5 Boilerplate + Twitter Bootstrap

I'm trying to start a new project, and was looking for the "ultimate" package to kick-start off with for PHP/MySQL/HTML5 development. Tried CodeIgniter first, which was great. Then discovered Twitter Bootstrap, and integrated that in nicely. Finally, found HTML5 Boilerplate, which looked awesome, and saw that some people were putting together mixes of these three.
Was wondering if anyone has actually been able to put together and run an integration of all three well? I see there's a github repo for this: https://github.com/vesparny/codeigniter-html5boilerplate-twitter-bootstrap, but I couldn't find any StackOverflow inquiries on it. Anyone have some experience they could share before I jump in? Didn't want to spend days trying to figure it out, just to find out it would've been easier/better to just stick with pure CodeIgniter or just HTML5BP.
i'm the author of that library you've looking into. https://github.com/vesparny/codeigniter-html5boilerplate-twitter-bootstrap
Tw bootstrap and H5BP can be simply mixed together as you can see in my code;
Codeigniter is a great framework but lacks in view organization imho.
With this library you can take advantage of the best client side tools, and the most famous and simple php framework with some enhancement that would speed up and better organize your code and approach to code with codeigniter.
Seems like not many people try this I guess, but it DOES work, and it works fine as far as I can tell.
CodeIgniter works well as the php framework, and you can integrate the HTML5 BP to render your pages in a HTML5-friendly way, with a few javascript libraries like Initialzr's modernizer to help with loading resources. CodeIgniter is pretty fast, and there is pretty much zero conflict when combining CI with HTML5 BP, making it a pretty quick and painless addition.
Twitter Bootstrap works fine as well, since it's mainly CSS and javascript plugins for components, which you can merge with HTML5's plugins.js file if you want / need it. I'd say that after playing with this, Twitter Bootstrap isn't really necessary, but it does help you put together a responsive front-end pretty quickly. Not sure if there are other packages out there that might be better.
How do you want to run an installation of css and javascript file?
Take HTML5 Boilerplate and Twitter bootstrap files and copy them into your website root directory (directory where is your Codeigniter application folder located).
Now you can use them as any other javascript/html/css libraries and frameworks.
And I still don't know why are you trying to use Twitter Bootstrap with HTML5 Boilerplate. I am not using any of these but they look similar. It looks like a little overhead for your website.

Are there any limits in using a PHP framework?

I'm planning to use a PHP framework (Yii) for my future project due to the amount of features that it would contain. I have done a few PHP projects in the past and I now realize how disorganized they can get after a while, even if you use a proper directory structure. So, basically, I'm wondering if everything in PHP, can also be done in a framework without tweaking the core framework itself. Will there be any limits? Can I use PHP classes like geolocation, phpexcel or phpthumb: http://phpthumb.gxdlabs.com? Preferably Yii. Thank you!
I'm wondering if everything in PHP, can also be done in a framework without tweaking the core framework itsel
No, every framework has its limits but some are more flexible than others. For example, some frameworks don't allow you to connect to multiple data-sources with their model implementation. But if it's a decent framework, you should be able to extend or swap out those shortcomings with your own or another implementation.
Can I use PHP classes like geolocation, phpexcel or phpthumb
Yes, most frameworks allow easy integration with other libraries. I found a link showing how to integrate phpexcel with Yii:
http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/
Yes All framworks have proscons, but it's very important that how we will user them, i.e cakephp provide the helper class to create html and form but no need to use each and every time that because it will make slow your application
CakePHP have also cache memory limitation, we found in one popular auction script.

PHP framework that can be included in other projects

I have a little specific concern, I hope you can help me, I have to develop an application in PHP that doesn't need to be linked to the exclusive use of its installation and could be used or "included" in other projects of PHP, I mean, to develop a web application (such as generation of a graph according to certain parameters passed) that can be used on different pages created for example in phpBB, Drupal, Dreamweaver or PHP Frameworks like CodeIgniter and Zend.
The best example of what I mean is "Google Charts Tools", you just print in the browser the access to the tool with the parameters and the tool does the rest, and this does not depend on the type of framework with which the home page was created.
In short, I'm looking for a framework or lightweight framework with which I can develop an application that simply could be called in an include() or require() on the destination page and can be used, a framework that can somehow "export" the project or application and could be used on one page without having to reinstall the framework on the target server, even the libraries could be included in the target page so you can run the application.
Was working with Codeigniter and tried to attach to a Joomla page but i couldn't because Codeigniter is linked to the URL of the page and I dont want to use Iframes.
Is there something like that?
First of all; I believe you would need some custimization, as frameworks just aren't build that way. But it isn't impossible. In Kohana for example (also codeigniter, but kohana is more flexible), you can build internal requests with Request::factory($uri). If you can find out a way to bypass direct access to index.php, or build a wrapper after which you can do stuff in the Kohana 'environment' you could do it. I don't have a ready-to-use solution, but if you try something and post the code we might be able to help you out some more!
Sounds to me like you want to write a library or class that can do certain things and which can be reused in other code. You can then build an example application around it, using a framework, which uses this library.
If you start with a whole framework, this often makes it really hard to reuse any part of the code, since the framework has certain assumptions or requirements which may not always be true for other projects. As a general rule: a framework is already a complete standalone application. What you want is something smaller than that.
Of course, you can have a look at a framework like Zend, which is basically just a loose collection of individual classes. Together they form a framework, but each part of it is individually usable. Something like CI is on the other end of the spectrum, much more heavily coupled and interdependent.

CakePHP to CodeIgniter conversion

I want to convert an application from CakePHP to Code Igniter. Has anyone tried to do this? With my CakePHP application almost all the coding has been done in the controller layer, with the models pretty much exactly as they come out of baking.
CakePHP is newer, more feature rich and heavier than Code Igniter (CI is designed to have a much smaller footprint) so you will most likely find yourself creating functionality in CI to match cake's.
CakePHP also handles some core capabilities differently than CI. For example, routing functionality is handled via a dedicated class rather than per controller as in CI (via _remap).
I have never seen a tool that helps to automate such a conversion as it's rarely, if ever, done.
Taking all that into account, I believe the best approach is to rebuild your application from the ground up, drawing on your existing code and database schema.

Categories