Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Optim: Route name and path
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayoshi-dev committed May 19, 2020
2 parents 4666cb2 + 01aa523 commit 447b3ae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
17 changes: 11 additions & 6 deletions src/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

/**
* Class AdminController
* @package App\Controller
* @Route("/admin", name="admin.")
*/
class AdminController extends AbstractController
{
/**
* @Route("/admin", name="admin.index")
* @Route("/", name="index")
*/
public function index()
{
return $this->render('admin/home/index.html.twig');
}

/**
* @Route("/admin/new-notification", name="admin.newNotification")
* @Route("/new-notification", name="newNotification")
* @param Request $request
* @return Response
*/
Expand Down Expand Up @@ -61,7 +66,7 @@ public function newNotification(Request $request)
}

/**
* @Route("/admin/notifications", name="admin.notifications")
* @Route("/notifications", name="notifications")
* @return Response
*/
public function listNotification()
Expand All @@ -70,7 +75,7 @@ public function listNotification()
}

/**
* @Route("/admin/new-food", name="admin.newFood")
* @Route("/new-food", name="newFood")
* @param Request $request
* @param FileUploader $fileUploader
* @return \Symfony\Component\HttpFoundation\Response
Expand Down Expand Up @@ -107,7 +112,7 @@ public function newFood(Request $request, FileUploader $fileUploader)
}

/**
* @Route("/admin/new-meal", name="admin.newMeal", options={"expose"=true})
* @Route("/new-meal", name="newMeal", options={"expose"=true})
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
Expand All @@ -117,7 +122,7 @@ public function newMeal(Request $request)
}

/**
* @Route("/admin/new-booking", name="admin.newBooking")
* @Route("/new-booking", name="newBooking")
* @return Response
*/
public function newBooking()
Expand Down
9 changes: 7 additions & 2 deletions src/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

/**
* Class DashboardController
* @package App\Controller
* @Route("/dashboard", name="dashboard.")
*/
class DashboardController extends AbstractController
{
/**
* @Route("/dashboard", name="dashboard.index", options={"expose"=true})
* @Route("/", name="index", options={"expose"=true})
*/
public function index()
{
Expand All @@ -24,7 +29,7 @@ public function index()
}

/**
* @Route("/dashboard/newchild", name="dashboard.newchild")
* @Route("/newchild", name="newchild")
* @param Request $request
* @return RedirectResponse|Response
*/
Expand Down
6 changes: 0 additions & 6 deletions src/Controller/SignupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

namespace App\Controller;

use App\Entity\User;
use App\Form\RegistrationFormType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;

class SignupController extends AbstractController
{
Expand Down

0 comments on commit 447b3ae

Please sign in to comment.