compact laravel
return View::make('myviewfolder.myview', compact('view1','view2','view3'));
compact laravel
return View::make('myviewfolder.myview', compact('view1','view2','view3'));
laravel php what does compact
// compact() is a php function that allows you to create an array with variable names and their values
<?php
$city = "San Francisco";
$state = "CA";
$event = "SIGGRAPH";
$location_vars = array("city", "state");
$result = compact("event", $location_vars);
print_r($result);
?>
The above example will output:
Array
(
[event] => SIGGRAPH
[city] => San Francisco
[state] => CA
)
// Like the post if you found it usefull and help other devs to find the good answer
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us