/** * Display a listing of positions * * @return Response */ public function index() { // $positions = DB::table('positions')->get(); // $positions = // [ // 'positions' => $positions // ]; // return View::make('positions.index', $positions)->withTitle('Jabatan'); $positions = Position::all(); return View::make('positions.index', compact('positions'))->withTitle('Jabatan'); }
public function showMap() { $position = Position::all(); return View::make('map')->with('position', $position->toJson()); }
public function getAll() { $obj = new Position($this->db); echo json_encode($obj->all()); }
</td> </tr> @endforeach </tbody> </table> </div> <div class="panel panel-footer"> </div> </div> <script> $(document).ready(function(){ $('#example').dataTable({ responsive: true }).columnFilter({ aoColumns: [ null, { type: "text" }, { type: "text" }, { type: "select", values: [<?php foreach (Position::all() as $val) { echo "'" . $val->name . "',"; } ?> ] } ] }); }); </script> @stop
/** * Display a listing of the resource. * * @return Response */ public function index() { $positions = Position::all(); return View::make('backend.positions.index')->with('positions', $positions); }