blade icon indicating copy to clipboard operation
blade copied to clipboard

Resource 'cache' already exists and is not a CI_Cache instance.

Open alfredboqi opened this issue 2 years ago • 1 comments

I can't use on CI 3. How can I fix this issue ?

alfredboqi avatar Jan 20 '23 08:01 alfredboqi

Hi, I also CodeIgniter 3 and done it with:

  1. Create new helper called view_helper.php
<?php

use Jenssegers\Blade\Blade;

if (!function_exists('view')) {
	function view($view, $data = [])
	{
		$ci  = & get_instance();
		$path  = APPPATH . 'views';
		$blade = new Blade($path, $path . '/cache');

		echo $blade->make($view, $data);
	}
}
  1. Add view_helper to application/config/autoload.php for easier usage
  2. Then you can call the view function in the controller, etc...

ngekoding avatar Aug 31 '23 00:08 ngekoding