Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to Passing Data to Views ?



How to Passing Data to Views ?..

Answer / rachana devi

While building application it may be required to pass data to the views.
Pass an array to view helper function.
After passing an array, we can use the key to get the value of that key in the HTML file.

Example :

Observe the following example to understand more about passing data to views -
Copy the following code and save it at resources/views/test.php

<html>
<body>
<h1><?php echo $name; ?></h1>
</body>
</html>

Add the following line in app/Http/routes.php file to set the route for the above view.
app/Http/routes.php

Route::get('/test', function(){
return view('test',[‘name’=>’Virat Gandhi’]);
});

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

How to bind a service container to a service provide.

0 Answers  


Name databases supported by laravel.

0 Answers  


Explain some benefits of laravel over other php frameworks.

0 Answers  


What are system requirement for laravel 5.0?

0 Answers  


What is rate limiting?

0 Answers  


Explain me how to assign multiple middleware to laravel route ?

0 Answers  


What is design pattern in laravel?

0 Answers  


What is lts in laravel?

0 Answers  


What do you mean by laravel dusk?

0 Answers  


What are the operations perfom while Connecting the Database ?

1 Answers  


How install react js in laravel?

0 Answers  


Tell me what is official website url of laravel?

0 Answers  


Categories