Skip to content

Commit

Permalink
README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
DasunNethsara-04 committed Nov 2, 2024
1 parent 77bbdd5 commit dc7412b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,24 @@ The **Pluto** template engine in ZenithPHP allows you to easily build dynamic vi
- **Section Definition**: Use `@section` to define a section that can be filled in child templates.
### Example Syntax
`HomeController.php`
```php
class HomeController extends Controller
{
public function index(Request $request, Response $response)
{
return view('home', [
'username' => 'John Doe',
'userRole' => 'admin',
'items' => [
(object) ['name' => 'Laptop', 'price' => '$999'],
(object) ['name' => 'Smartphone', 'price' => '$499'],
]
]);
}
}
```
`home.pluto.php`
```php
<!-- Displaying a variable -->
<< $username >>
Expand Down

0 comments on commit dc7412b

Please sign in to comment.