Working
- Update Coupon BackOffice routing
This commit is contained in:
@@ -37,16 +37,20 @@
|
||||
|
||||
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
||||
<route id="admin.coupon.list" path="/admin/coupon">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::indexAction</default>
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">browse</default>
|
||||
</route>
|
||||
<route id="admin.coupon.create" path="/admin/coupon/create">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::createAction</default>
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">create</default>
|
||||
</route>
|
||||
<route id="admin.coupon.edit" path="/admin/coupon/edit">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::editAction</default>
|
||||
<route id="admin.coupon.edit" path="/admin/coupon/edit/{id}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">edit</default>
|
||||
</route>
|
||||
<route id="admin.coupon.read" path="/admin/coupon/read">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::readAction</default>
|
||||
<route id="admin.coupon.read" path="/admin/coupon/read/{id}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">read</default>
|
||||
</route>
|
||||
|
||||
<!-- The default route, to display a template -->
|
||||
|
||||
@@ -46,37 +46,7 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->processAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Coupon Action
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
return $this->processAction('create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a Coupon Action
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function editAction()
|
||||
{
|
||||
return $this->processAction('edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a Coupon Action
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function readAction()
|
||||
{
|
||||
return $this->processAction('read');
|
||||
return $this->process();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,10 +112,11 @@ class CouponController extends BaseAdminController
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function processAction($action = 'browse')
|
||||
public function processAction()
|
||||
{
|
||||
var_dump($this->getRequest()->attributes);
|
||||
// Get the current action
|
||||
// $action = $this->getRequest()->get('action', 'browse');
|
||||
$action = $this->getRequest()->get('action', 'browse');
|
||||
|
||||
// Get the category ID
|
||||
// $id = $this->getRequest()->get('id', 0);
|
||||
|
||||
Reference in New Issue
Block a user