Skip to content

Commit

Permalink
Merge branch 'release/v5.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yajra committed Aug 12, 2015
2 parents e945983 + 42da23a commit 19d5690
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

##Change Log

###v5.11.0
- Add support for rendering view directly on addColumn and editColumn.

###v5.10.0
- Add LaravelDataTables on js window namespace. Issue #129. Credits to @greabock.

Expand Down
4 changes: 4 additions & 0 deletions src/yajra/Datatables/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public static function compileContent($content, array $data, $param)
*/
public static function compileBlade($str, $data = [])
{
if (view()->exists($str)) {
return view($str, $data)->render();
}

$empty_filesystem_instance = new Filesystem();
$blade = new BladeCompiler($empty_filesystem_instance, 'datatables');
$parsed_string = $blade->compileString($str);
Expand Down
19 changes: 19 additions & 0 deletions tests/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,22 @@ function app($instance) {

return new Datatables(Request::capture());
}

function view($view = null, array $data = []) {
if ( ! $view) {
return new BladeView();
}

return (new BladeView())->exists($view);
}

/**
* Blade View Stub
*/
class BladeView
{
public function exists($view)
{
return false;
}
}

0 comments on commit 19d5690

Please sign in to comment.