<?php use Fuel\Core\Session; use Fuel\Core\Lang; use \Process;//Package qui reprend tous les traitements use Process\Crypt;//Package qui reprend tous les traitements use Process\Format_data;//Package qui reprend tous les traitements use Process\Cmd; class Controller_Norm extends Controller_Template { public function action_index($nni=null) { if(!is_null($nni)){//Create a SESSION variable Session::set('nni',$nni);//Crée une variable de session } else { Response::redirect('norms/404'); } $data['versions'] = Format_data::get_all_version(); $data['services'] = Format_data::get_all_service(); $this->template->title = Lang::get('title'); $this->template->content = View::forge('norm/index',$data); } public function after($response){ Session::set('test', 'test); return $response; } public function action_404() { return Response::forge(ViewModel::forge('norm/404'), 404); } }
Event::register('shutdown', 'Myclass::mymethod');and your method in your class is called. Fuel uses the shutdown event internally to execute cleanup functions, and to flush the session...
\Event::register('shutdown', function() {(note that you should check if the referer points to your side, to avoid redirecting away from your site)
\Session::set('previous_url', \Input::server('referer', null));
});
It looks like you're new here. If you want to get involved, click one of these buttons!