Skip to content

Commit 326d85a

Browse files
committed
chore: update readme
1 parent 6a05fce commit 326d85a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

readme.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,22 @@ Since Leaf UI is modelled after React, everything is a component. You can create
3838
```php
3939
<?php
4040

41-
use Leaf\UI\Core;
4241
use Leaf\UI\Component;
4342

4443
class Test2 extends Component
4544
{
45+
// every component needs a unique key
46+
public $key = "test2";
4647
public $count = 1;
4748

4849
public function increment()
4950
{
50-
$this->count = $this->count + 1;
51+
$this->count++;
5152
}
5253

5354
public function decrement()
5455
{
55-
$this->count = $this->count - 1;
56+
$this->count--;
5657
}
5758

5859
public function render()
@@ -63,7 +64,7 @@ class Test2 extends Component
6364
<div>
6465
<div>Static text</div>
6566
<button @click="decrement">-</button>
66-
<h1>' . $this->count . '</h1>
67+
<h1>{{ $count }}</h1>
6768
<button @click="increment">+</button>
6869
</div>
6970
</body>
@@ -79,17 +80,19 @@ To actually make this work, you simply need to render this component wherever yo
7980
```php
8081
<?php
8182

82-
use Leaf\UI\Core;
83+
use Leaf\UI;
8384

84-
require_once __DIR__ . '/vendor/autoload.php';
85+
require __DIR__ . '/vendor/autoload.php';
8586

86-
echo Core::render(new Test2());
87+
UI::render(new Test2());
8788
```
8889

8990
The most beautiful part about all this is that it can run outside Leaf. It is completely independent of Leaf or any other framework and can be used in any PHP application.
9091

9192
_This file is still being updated!_
9293

94+
***Docs @ https://staging.ui.leafphp.dev are still being updated.***
95+
9396
## 💬 Stay In Touch
9497

9598
- [Twitter](https://twitter.com/leafphp)

0 commit comments

Comments
 (0)