User controller preparations.

This commit is contained in:
Alexey Skobkin 2015-05-30 09:50:44 +03:00
parent 097488446a
commit 5b63cac5ec
4 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,26 @@
<?php
namespace Skobkin\Bundle\PointToolsBundle\Controller;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\ORM\EntityManager;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class UserController extends Controller
{
public function showAction($login)
{
return $this->render('SkobkinPointToolsBundle:User:show.html.twig', []);
}
public function topAction()
{
/** @var EntityManager $em */
$em = $this->getDoctrine()->getManager();
/** @var QueryBuilder $qb */
$qb = $em->getRepository('SkobkinPointToolsBundle:Subscription')->createQueryBuilder('us');
}
}

View file

@ -1,3 +1,11 @@
index: index:
path: / path: /
defaults: { _controller: SkobkinPointToolsBundle:Main:index } defaults: { _controller: SkobkinPointToolsBundle:Main:index }
user_show:
path: /user/{login}
defaults: { _controller: SkobkinPointToolsBundle:User:show }
users_top:
path: /top
defaults: { _controller: SkobkinPointToolsBundle:User:top }

View file

@ -0,0 +1,7 @@
{% extends "::base.html.twig" %}
{% block title %}SkobkinPointToolsBundle:User:show{% endblock %}
{% block body %}
<h1>Welcome to the User:show page</h1>
{% endblock %}

View file

@ -0,0 +1,16 @@
<?php
namespace Skobkin\Bundle\PointToolsBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class UserControllerTest extends WebTestCase
{
public function testShow()
{
$client = static::createClient();
$crawler = $client->request('GET', '/user/{login}');
}
}