Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to fetch request variable in symfony2

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 261
    Comment on it

    Hello Friends,

    If you are looking to fetch request variable submitted through GET method in Symfony2. Suppose your URL :: http://www.abc.com/taxsetting/list?q=xyx

    You are looking to fetch q value in your controller, please review code below

    class TaxsettingController extends Controller
    {
    
    public function listAction(Request $request){
    
    if(!empty($request->query->get('q'))){
                $getData = $request->query->get('q'); // $getData will have q data
    
               echo $getData;  // This will print xyz
    
    }
    
    }

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: