view() public method

The user is responsible to populate the view with the wished columns, because they can not be derived from the server side column configuration.
public view ( string $tableView = null, string $scriptView = null ) : DatatableView
$tableView string the name of the table view to render
$scriptView string the name of the script view to render
return OpenSkill\Datatable\Views\DatatableView the view to work with
コード例 #1
0
ファイル: DatatableTest.php プロジェクト: tallcoder/Datatable
 /**
  * Will test if a new ColumnComposer will be instantiated correctly
  */
 public function testViewConstruction()
 {
     $versionEngine = Mockery::mock('OpenSkill\\Datatable\\Versions\\VersionEngine');
     $versionEngine->shouldReceive('getVersion')->andReturn();
     $dt = new Datatable($versionEngine);
     $dtv = $dt->view();
 }
コード例 #2
0
 /**
  * Will test if a new ColumnComposer will be instantiated correctly
  */
 public function testViewConstruction()
 {
     $version = Mockery::mock('OpenSkill\\Datatable\\Versions\\Version');
     $version->shouldReceive('tableView')->andReturn('fooBar');
     $version->shouldReceive('scriptView')->andReturn('fooBar');
     $versionEngine = Mockery::mock('OpenSkill\\Datatable\\Versions\\VersionEngine');
     $versionEngine->shouldReceive('getVersion')->andReturn($version);
     $viewFactory = Mockery::mock('Illuminate\\Contracts\\View\\Factory');
     $configRepository = Mockery::mock('Illuminate\\Contracts\\Config\\Repository');
     $configRepository->shouldReceive('get')->andReturn("fooBar");
     $dt = new Datatable($versionEngine, $viewFactory, $configRepository);
     $dtv = $dt->view();
 }