Beispiel #1
0
 /**
  * Checks/Updates the schema an generates a list of applied versions
  *
  * @param Application $app
  * @return Response
  */
 public function handleSchemaVersionsRequest(Application $app)
 {
     $appliedVersions = $app['schema']->checkSchema();
     $params = ['pageTitle' => 'Schema Versions', 'content' => '
             <h2>Applied Schema Versions</h2>
             <ul>
                 <li>' . join('</li><li>', $appliedVersions) . '</li>
             </ul>
         '];
     $template = $app->config('templates')->content;
     return $app->render($template, $params);
 }
 /**
  * Serves a login form
  *
  * @param Application $app Application instance
  *
  * @return Response A Response instance
  */
 public function renderLoginForm(Application $app)
 {
     $params = ['pageTitle' => 'Login', 'token' => $app['security']->getToken('login'), 'usernameLabel' => 'Email', 'passwordLabel' => 'Password', 'buttonLabel' => 'Sign in', 'errorText' => 'Wrong email or password. Please try again'];
     $template = $app->config('templates')->login;
     return $app->render($template, $params);
 }
 /**
  * Generates a (default) welcome response
  *
  * @param Application $app
  *
  * @return Response A Response instance
  */
 public function handleHomeRequest(Application $app)
 {
     $params = ['pageTitle' => 'Welcome', 'content' => 'Welcome to Polymorph'];
     $template = $app->config('templates')->content;
     return $app->render($template, $params);
 }