PHP Classes

File: src/Acme/Controller/AdminController.php

Recommend this page to a friend!
  Classes of Rafael Espinosa   Silex Enhanced   src/Acme/Controller/AdminController.php   Download  
File: src/Acme/Controller/AdminController.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Silex Enhanced
Silex with custom services providers.
Author: By
Last change: Initialized repository with application skeleton and demo files.
Date: 8 years ago
Size: 1,218 bytes
 

Contents

Class file image Download
<?php
/**
 * PHP version ~5.5
 *
 * @category Controller
 * @package Fluency\Acme\Controller
 * @author Rafael Ernesto Espinosa Santiesteban <ralphlnx@gmail.com>
 * @license MIT <http://www.opensource.org/licenses/mit-license.php>
 * @link http://fluency.inc.com
 */

namespace Fluency\Acme\Controller;

use
Silex\Application;
use
Symfony\Component\HttpFoundation\Request;

/**
 * Class AdminController
 *
 * @category Controller
 * @package Fluency\Acme\Controller
 * @author Rafael Ernesto Espinosa Santiesteban <ralphlnx@gmail.com>
 * @license MIT <http://www.opensource.org/licenses/mit-license.php>
 * @link http://fluency.inc.com
 */
class AdminController
{
   
/**
     * Login controller action
     *
     * @param Request $request Request for this action
     * @param Application $app Silex application instance
     *
     * @return mixed
     */
   
public function loginAction(Request $request, Application $app)
    {
        return
$app['twig']->render(
           
"acme/admin/login.html.twig", array(
           
'error' => $app['security.last_error']($request),
           
'last_username' => $app['session']->get('_security.last_username'),
            )
        );

    }
}