Package Data | |
---|---|
Maintainer Username: | jimtendo |
Maintainer Contact: | zuccon@gmail.com (James Augustus Zuccon) |
Package Create Date: | 2016-01-29 |
Package Last Update: | 2016-10-14 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-04-28 15:10:08 |
Package Statistics | |
---|---|
Total Downloads: | 27 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Add this library to your composer.json file: "jimtendo/jazzycrud": "dev-master"
Add Service Provider to config/app.php
: 'Jimtendo\JazzyCRUD\ServiceProvider'
Make sure the following libraries are included in your main layout file:
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/plug-ins/9dcbecd42ad/integration/bootstrap/3/dataTables.bootstrap.css">
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/plug-ins/9dcbecd42ad/integration/bootstrap/3/dataTables.bootstrap.js"></script>
Use like follows:
$crud = new \Jimtendo\JazzyCRUD\Basic;
$crud = $crud->from('feeds')
->lists(['id'=>'id', 'url'=>'url'])
->creates(['id'=>'id', 'url'=>'url'])
->shows(['id'=>'id', 'url'=>'url'])
->edits(['id'=>'id', 'url'=>'url'])
->titles(['id'=>'Id', 'url'=>'URL'])
->customize('url', function($value){ return $value . 'hello'; })
->render();
echo $crud;
This doesn't support joins
. In future, should all columns be formatted thusly: tableName['field']
?
Would we be able to add custom handlers if the tableName
cannot be found by doing it this way? i.e. If we're querying an API?
Also, another thing that might be worth doing is making the 'actions' themselves hooks.
e.g. In constructor: $this->handleAction('list', $this->performList)
This would allow a user to over-ride any particular action.
Should field-types also be hooks? I.e. $this->handleType('imageUpload', $this->handleImageUpload);