Skip to content

Commit

Permalink
Added doc block about ArrayAdapter;
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ome committed Feb 8, 2015
1 parent 72e8ed0 commit 37cdba1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ class TestController extends \Phalcon\Mvc\Controller {
}
```

### Controller (using Array):
```php
<?php
use \DataTables\DataTable;

class TestController extends \Phalcon\Mvc\Controller {
public function indexAction() {
if ($this->request->isAjax()) {
$array = $this->modelsManager->createQuery("SELECT * FROM \Example\Models\User")
->execute()->toArray();

$dataTables = new DataTable();
$dataTables->fromArray($array)->sendResponse();
}
}
}
```

### Model:
```php
<?php
Expand Down

0 comments on commit 37cdba1

Please sign in to comment.