A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
654B

  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Knockout\Subforum;
  4. use App\Knockout\Stat;
  5. class IndexController extends Controller {
  6. public function get()
  7. {
  8. $stats = Stat::all()->getRecord();
  9. $subforums = Subforum::all();
  10. $records = $subforums->getRecords();
  11. $len = count($records);
  12. $leftSubforums = array_slice($records, 0, $len / 2);
  13. $rightSubforums = array_slice($records, $len / 2);
  14. $html = view('page/index', [
  15. 'leftSubforums' => $leftSubforums,
  16. 'rightSubforums' => $rightSubforums,
  17. 'stat' => $stats
  18. ]);
  19. return $html;
  20. }
  21. }