Skip to content

Commit 4881f79

Browse files
committed
wip
1 parent ab0433d commit 4881f79

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

DOCUMENTATION.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,40 @@
1-
# statamic-blade-components
1+
# Statamic Blade Components
22

33
![Statami v3](https://img.shields.io/badge/Statamic-3.0+-FF269E)
44
![Packagist](https://img.shields.io/packagist/v/octoper/statamic-blade-components)
55
![Test Suite](https://github.com/octoper/statamic-blade-components/workflows/Test%20Suite/badge.svg)
66

7-
A Laravel Blade component integration for Statamics Antlers template engine.
7+
A [Laravel Blade Components](https://laravel.com/docs/7.x/blade#components) integration for Statamics Antlers template engine.
88

9-
## Documentation
10-
[Read](./DOCUMENTATION.md) this addon's documentation.
9+
## Installation
10+
Pull in your package with composer
11+
```bash
12+
composer require octoper/statamic-blade-components
13+
```
1114

12-
## Resources
13-
* [Statamic 3 Docs](https://statamic.dev)
14-
* [Statamic Discord](https://statamic.com/discord)
15+
## General documentation
16+
[Laravel Blade Components](https://laravel.com/docs/7.x/blade#components)
17+
18+
## How to be used with the Antlers template engine
19+
```html
20+
{{ component:hello }}
21+
```
22+
23+
### Passing Initial Parameters
24+
You can pass data into a component by passing additional parameters
25+
26+
```html
27+
{{ component:avatar username="johndoe" }}
28+
```
29+
30+
### Passing Slots
31+
You can pass additional content to your component via "slots" too.
32+
33+
```html
34+
{{ component:label for="email" }}
35+
Email
36+
{{ /component }}
37+
```
1538

1639
## Security
1740

@@ -21,3 +44,6 @@ If you discover any security related issues, please email me@octoper.me instead
2144

2245
- [Vaggelis Yfantis](https://github.com/octoper)
2346
- [All Contributors](../../contributors)
47+
48+
# License
49+
This plugin is published under the MIT license. Feel free to use it and remember to spread love.

src/Tags/BladeComponent.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
class BladeComponent extends Tags
1717
{
18-
protected static $handle = 'x';
18+
protected static $handle = 'component';
19+
20+
protected static $aliases = ['x'];
1921

2022
public function wildcard(string $expression): string
2123
{

0 commit comments

Comments
 (0)