-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c4185b
commit f9c6e88
Showing
6 changed files
with
85 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: ian | ||
* Date: 2017/04/12 | ||
* Time: 10:21 AM | ||
*/ | ||
|
||
namespace IanRothmann\LaravelVueBridge; | ||
|
||
|
||
use Illuminate\Support\Facades\Route; | ||
|
||
trait ExposeClosure | ||
{ | ||
|
||
private $closures=[]; | ||
|
||
public function exposeClosureResult($varName,$closure){ | ||
if($closure instanceof \Closure) { | ||
$this->closures[$varName] = $closure; | ||
} | ||
} | ||
|
||
private function getClosureVariables(){ | ||
|
||
$data=[]; | ||
foreach ($this->closures as $varName=>$closure){ | ||
$data[$varName]=$closure(); | ||
} | ||
|
||
return $data; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
function vbview($view, $data = array(), $mergeData = array()){ | ||
return VueBridge::view($view, $data, $mergeData); | ||
} |