Laravel 4: Generate HTML Table Like CodeIgniter

前端 未结 3 1998
[愿得一人]
[愿得一人] 2020-12-18 15:28

So in CodeIgniter, there was a cool feature of creating an HTML table just by passing it an array and it handles the header, etc. Is there ANYTHING out there for Laravel, ha

3条回答
  •  春和景丽
    2020-12-18 16:15

    You could take the script drupal uses and convert it to laravel: https://api.drupal.org/api/drupal/core%21includes%21theme.inc/function/theme_table/8

    Doing a quick look at it, you would just need to replace a couple of functions:

    • Attributes()... I think laravel has something like this you could use. Drupal 8 is using something from symfony2 I think... laravel might be using the same thing.
    • _theme_table_cell(), tablesort_header(), etc... These type of functions have drupal_render() in them... you don't want to try and port that over... so you probably just delete that from the functions (untested) as it doesn't make sense in the context of laravel .

    This would make for a very nice implementation of what your looking for.

    EDIT: I also just ran into this: http://kohana.keyframesandcode.com/docs/modules/table/ I've not tested it but it was referenced here: http://forumsarchive.laravel.io/viewtopic.php?id=2178

提交回复
热议问题