You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -314,10 +314,10 @@ You can also just add a predefined Column, like a DateColumn, a FunctionColumn,
314
314
E.g.:
315
315
316
316
```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
321
321
322
322
Datatable::collection(User::all())
323
323
->addColumn($column)
@@ -328,7 +328,7 @@ You can also overwrite the results returned by the QueryMethod by using addColum
328
328
You must name the column exactly like the database column that you're displaying using showColumns in order for this to work.
329
329
330
330
```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); }
0 commit comments