Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alfredboqi opened this issue Jan 20, 2023 · 1 comment
Open

Comments

@alfredboqi
Copy link

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

@ngekoding
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants