Can't call ci inbuilt library inside view
When try to access session inside view ite throw error.
I have tried fallowing inside view $this->session->flashdata('error') )
Severity: Notice Message: Undefined property: Xiaoler\Blade\Engines\CompilerEngine::$session
Fatal error: Call to a member function flashdata() on null
@shravanjbp
if you want to use $this in view,you should
$vars = ['this'=>$this];
$this->blade->view('welcome_message', $vars);
But I don't recommend doing this.
@rainwsy
So there is any better way to achieve this.
I can handle session without $this but i need to call some model function inside view.
@shravanjbp I do not recommend this, this is not standardized. You should set value in controller
Try it.
Use this in your library
$this->factory->share('_ci', get_instance());
Change $this to $_ci
Example
$_ci->session->flashdata('error')