In my job there’s a Codeingiter 2.x project running in an obsolete version of PHP.
Therefore as an upgrade we want to migrate into Laravel. But due to manpower starvation and time starvation I though I could reuse the codeingiter’s legacy views with some tweaking.
The poroblem is how I can use both Codeigniter’s alongside with laravel’s blade views?
The laravel version is the 5.8 one.
2
Answers
If I’m reading it correctly CodeIgniter uses plain PHP for views (it’s a bit hard to find 2.x docs), without the use of a templating engine (like Laravel uses Blade).
This is supported by Laravel out of the box, instead of naming your view
home.blade.php
just call ithome.php
which would still work. Laravel determines the view engine to use based on the extension, but both plain PHP and Blade are supported out of the box.You could still call your views
home.blade.php
by the way since PHP tags are supported in Blade views too so it should be easy to sprinkle in some Blade as you go.The only thing is that you will have to check each view for the usage of CodeIgniter specific code and helper function but since it’s just PHP it should just work™.
I think it will spend more time to adjust, than to rewrite new laravel blade view. I suggest to use newest bootstrap to write fast your blade view.