Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tacone/rapyd-datatree
A sortable widget for Laravel 4.x + Rapyd
https://github.com/tacone/rapyd-datatree
Last synced: 7 days ago
JSON representation
A sortable widget for Laravel 4.x + Rapyd
- Host: GitHub
- URL: https://github.com/tacone/rapyd-datatree
- Owner: tacone
- Created: 2015-11-29T23:09:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-20T21:50:52.000Z (almost 9 years ago)
- Last Synced: 2024-04-17T14:42:35.731Z (7 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# DataTree for Rapyd
If you use Laravel 5 you don't need this repository, the datatree has been
merged in the core of [Rapyd](https://github.com/zofe/rapyd-laravel/)!If you use Laravel 4.2 and Rapyd you can use this repo to add the DataTree
to your app.## Installation
Before beginning, you need to add to your composer Baum\Baum as we don't add it
automatically for you.Add it to composer, add the service provider and publish the assets.
Add the service provider to app.php
```
'Tacone\RapydDataTree\RapydDataTreeServiceProvider',
```Add the css and js hooks in your template:
In the ``:
```
{{ DataTree::styles() }}```
At the end of the ``:
```
{{ DataTree::scripts() }}
```## Sample usage
```php
use Tacone\RapydDataTree\DataTree;class MyController extends Controller
{
public function anyIndex($rootId = null)
{
$rootId or App::abort(404);
$root = Menu::find($rootId) or App::abort(404);$tree = DataTree::source($root);
$tree->add('title');
$tree->edit("/admin/menu/edit", 'Edit', 'modify|delete');return View::make('admin/menu/index', compact('tree'));
}
}
```