Closed giwrgos88 closed 7 years ago
Ok I found a solution. So I added a function into "WordpressTemplateExtension"
public function getGlobals() {
return array(
'session' => $_SESSION,
);
}
An in my controller I did the following
session()->set('__form_data', $inputs);
session()->set('error', $validator->messages());
I'm using the session_flashed to get the input fields in case of an error but it returns back a null value. I have tested that I'm returning back an array of the inputs,which works, but on the view is null. same with my validation messages.
Also is good to mention that I'm loading the view using this method
herbert('Twig_Environment')->addExtension(new Test\WordpressTemplate\WordpressTemplateExtension());
Does anyone knows what is wrong?