From 12376ded3ceeb331ffa4ebf5d2563b84efa6769b Mon Sep 17 00:00:00 2001 From: SerhiiCho Date: Sun, 19 Nov 2023 17:50:11 +0200 Subject: [PATCH] Update README.md --- README.md | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 7b51cf7..14e8e3f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This package is not for creating a full-featured template engine. It's just a si ## What Goodbye HTML has? - [x] Variables -- [x] If/Else statements +- [x] If/Else-If/Else statements - [x] Ternary expressions - [x] Loops - [x] Prefix operators @@ -190,23 +190,7 @@ Infix operators are used to perform math operations or string concatenation. For ``` -```html - -
- {{ if $drinks_lots_of_water }} -

{{ $water_benefits }}

- {{ end }} -
-``` - -```html - -

- This package is cool -

-``` - -#### If / else statements +#### If/Else statements ```html @@ -226,21 +210,29 @@ Infix operators are used to perform math operations or string concatenation. For ``` +#### If/Else-If/Else statements + +> Similar to PHP, you can write `elseif` or `else if` in the same way. + ```html - +
- {{ if $animal }} -

{{ $tiger_var }}

+ {{ if $likes_bread }} +

I like bread

+ {{ else if $likes_cake }} +

I like cake

+ {{ elseif $likes_pizza }} +

I like pizza

{{ else }} -

{{ $fish_var }}

+

I don't really like anything

{{ end }}
``` ```html - +
-

{{ if $is_cat }}{{ $cat_var }}{{ else }}{{ $dog_var }}{{ end }}

+

I like {{ if $likes_bread }}bread{{ else if $likes_cake }}cake{{ else }}just water{{ end }}

```