Last active
March 15, 2017 14:25
-
-
Save shawnsandy/d22c612cc32200761de053b9f8f3cd9b to your computer and use it in GitHub Desktop.
Laravel components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* $data = dataset mixed|array|string required | |
* $title = component title string | |
* $attributes html attributes | |
* $view blade template optional | |
* */ | |
Html::component("component_name", "dash::components.test", ["data", 'title' => 'Title', "attributes" => [], 'view']); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aside class="panel {{ str_slug($title) }} {{ $attributes['class'] or "" }}"> | |
<div class="panel-body"> | |
<h4 class="h4 text-capitalize">{{ $title }}</h4> | |
<hr> | |
<!-- data --> | |
@foreach($data as $key => $item) | |
<p class=""> | |
<span class="collection-key collection-key-{{ $key }}">{{ $key }} </span> {{ $item }} | |
</p> | |
@endforeach | |
<!-- end --> | |
<!-- end --> | |
</div> | |
</aside> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* $data = dataset mixed|array|string | |
* $title = component title string | |
* $attributes html attributes | |
* $view blade template optional | |
* */ | |
Html::component("panel", "dash::components.test", ["data", 'title' => 'Testing', "attributes" => [], 'view']); | |
Html::component("widget", "dash::components.widget", ["data", 'title' => 'Widgets', "attributes" => [], 'view']); | |
Html::component("list-panel", "dash::components.list-panel", ['data', 'title' => 'Data Panel', "attributes" => [], 'view']); | |
Html::component("data-table", "dash::components.data-table", ['data' => [], 'title' => 'Data Panel', "attributes" => [], 'view']); | |
Html::component("card", "dash::components.card", ['data', 'title' => 'Card', "attributes" => [], 'view']); | |
Html::component("story", "dash::components.story", ['data', 'title' => 'Story', "attributes" => [], 'view']); | |
Html::component("collection", "dash::components.collection", ['data', 'title' => 'Collection', "attributes" => [], 'view']); | |
Html::component("list-panel-collection", "dash::components.list-panel", ['data', 'title' => 'Data Panel', "attributes" => [], 'view']); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- component --> | |
{{ Html::component( ["dog", "cat"], 'Component Title') }} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment