/** * Create a new form builder * * @param string $identifier Form identifier * * @return Symfony\Component\Form\FormBuilder */ public static function create($identifier, $data = null, array $options = array()) { $form = self::$app->form($data, $options); self::$forms[$identifier] = $form; EventDispatcher::dispatch('form.' . $identifier . '.create', new Event($form)); return $form; }
/** * Remove session and logout user */ public static function logout() { Session::remove('userId'); EventDispatcher::dispatch('auth.logout', self::$user); }
/** * Wrapper for EventDispatcher->addListener() * Add event listener to event dispatcher * * @param string $eventName The event to listen on * @param callable $listener The listener */ public function addEventListener($eventName, callable $listener) { EventDispatcher::addListener($eventName, $listener); }