Hello Friends,
If you are looking to implement routing in symfony2, like I have created a new controller like "listAction" in my controller file and now want to run this on browser. My controller file look like
<?php
namespace App\CamTaxsettingBundle\Controller;
use App\CamTaxsettingBundle\Form\WorkflowForm;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Filesystem\Filesystem;
class TaxsettingController extends Controller
{
public function listAction(){
echo "routing is working fine";
die;
}
}
Now I did open my_project_name/app/config/routing.yml and add the below code::
app_cam_taxsetting_list:
path: /taxsetting/list/{status}
defaults:
_controller: AppCamTaxsettingBundle:Taxsetting:list
status: inreview
step: null
requirements:
status: inreview|accepted|declined|notcompleted|itinverify
step: null|complete
0 Comment(s)