Fluent::init PHP Method

init() public static method

Initialise routes
public static init ( )
    public static function init()
    {
        // Attempt to do pre-emptive i18n bootstrapping, in case session locale is available and
        // only non-sitetree actions will be executed this request (e.g. MemberForm::forgotPassword)
        self::install_locale(false);
        // Regenerate routes
        self::regenerate_routes();
    }

Usage Example

 public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model)
 {
     // Ensures routes etc are setup
     // We need to inject the presented session temporarily, as there is no current controller set
     FluentSession::with_session($session, function () {
         Fluent::init();
     });
 }