Package Data | |
---|---|
Maintainer Username: | aizhar777 |
Maintainer Contact: | aizharolexin@gmail.com (Aizhar Olexin) |
Package Create Date: | 2016-10-28 |
Package Last Update: | 2016-10-28 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:10:00 |
Package Statistics | |
---|---|
Total Downloads: | 77 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Cell: The wrapper on a package of "donquixote/cellbrush" for Laravel
Begin by installing the package through Composer.
composer require aizhar777/cell
Once this operation is complete, simply add both the service provider and facade classes to your project's config/app.php file:
Aizhar777\Cell\CellServiceProvider::class,
'Cell' => Aizhar777\Cell\Facades\Cell::class,
A simple 3x3 table with the diagonal cells filled.
namespace App\Http\Controllers;
class TestController extends Controller
{
public function index()
{
$table = \Cell::create()
->addClass('table table-bordered')
->addRowNames(['row0', 'row1', 'row2'])
->addColNames(['col0', 'col1', 'col2'])
->td('row0', 'col0', 'Diag 0')
->td('row1', 'col1', 'Diag 1')
->td('row2', 'col2', 'Diag 2');
return view('test_view', ['table' => $table->render()]);
}
}
test_view.blade.php:
<!-- ... -->
{{ $table }}
<!-- ... -->
Groups can have unlimited depth.
$table = \Cell::create()
->addRowNames(['T', 'B.T', 'B.B.T', 'B.B.B'])
->addColNames(['L', 'R.L', 'R.R.L', 'R.R.R'])
->td('T', '', 'top')
->td('B', 'L', 'bottom left')
->td('B.T', 'R', 'B.T / R')
->td('B.B', 'R.L', 'B.B / R.L')
->td('B.B.T', 'R.R', 'B.B.T / R.R')
->td('B.B.B', 'R.R.L', 'B.B.B / R.R.L')
->td('B.B.B', 'R.R.R', 'B.B.B / R.R.R');
Result: