Skip to content

Commit 352037a

Browse files
committed
Docs update
1 parent 805b3bd commit 352037a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ You can also just add a predefined Column, like a DateColumn, a FunctionColumn,
314314
E.g.:
315315

316316
```php
317-
$column = new TextColumn('foo', 'bar'); // Will always return the text bar
318-
//$column = new FunctionColumn('foo', function($model){return $model->bar}); // Will return the bar column
319-
//$column = new DateColumn('foo', DateColumn::TIME); // Will return the foo date object as toTimeString() representation
320-
//$column = new DateColumn('foo', DateColumn::CUSTOM, 'd.M.Y H:m:i'); // Will return the foo date object as custom representation
317+
$column = new \Chumper\Datatable\Columns\TextColumn('foo', 'bar'); // Will always return the text bar
318+
//$column = new \Chumper\Datatable\Columns\FunctionColumn('foo', function($model){return $model->bar}); // Will return the bar column
319+
//$column = new \Chumper\Datatable\Columns\DateColumn('foo', DateColumn::TIME); // Will return the foo date object as toTimeString() representation
320+
//$column = new \Chumper\Datatable\Columns\DateColumn('foo', DateColumn::CUSTOM, 'd.M.Y H:m:i'); // Will return the foo date object as custom representation
321321

322322
Datatable::collection(User::all())
323323
->addColumn($column)
@@ -328,7 +328,7 @@ You can also overwrite the results returned by the QueryMethod by using addColum
328328
You must name the column exactly like the database column that you're displaying using showColumns in order for this to work.
329329

330330
```php
331-
$column = new FunctionColumn('foo', function ($row) { return strtolower($row->foo); }
331+
$column = new \Chumper\Datatable\Columns\FunctionColumn('foo', function ($row) { return strtolower($row->foo); }
332332
Datatable::query(DB::table('table')->select(array('foo')))
333333
->showColumns('foo')
334334
->addColumn($column)
@@ -340,7 +340,7 @@ This will allow you to have sortable and searchable columns using the QueryEngin
340340

341341
Eg: linking an user_id column to it's page listing
342342
```php
343-
$column = new FunctionColumn('user_id', function ($row) { return link_to('users/'.$row->user_id, $row->username) }
343+
$column = new \Chumper\Datatable\Columns\FunctionColumn('user_id', function ($row) { return link_to('users/'.$row->user_id, $row->username) }
344344
Datatable::query(DB::table('table')->select(array('user_id', 'username')))
345345
->showColumns('user_id')
346346
->addColumn($column)

0 commit comments

Comments
 (0)