User controller preparations.
This commit is contained in:
parent
097488446a
commit
5b63cac5ec
|
@ -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');
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,3 +1,11 @@
|
|||
index:
|
||||
path: /
|
||||
defaults: { _controller: SkobkinPointToolsBundle:Main:index }
|
||||
|
||||
user_show:
|
||||
path: /user/{login}
|
||||
defaults: { _controller: SkobkinPointToolsBundle:User:show }
|
||||
|
||||
users_top:
|
||||
path: /top
|
||||
defaults: { _controller: SkobkinPointToolsBundle:User:top }
|
|
@ -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 %}
|
|
@ -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}');
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue