Skip to content

Commit

Permalink
add symfony doc
Browse files Browse the repository at this point in the history
  • Loading branch information
KHOUBZA Younes committed Jan 11, 2023
1 parent 2a25986 commit 77c77b1
Show file tree
Hide file tree
Showing 19 changed files with 631 additions and 218 deletions.
6 changes: 3 additions & 3 deletions _data/entrypoints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"/dist/homepage.11d1d76a.js"
],
"css": [
"/dist/857.6650c424.css",
"/dist/857.ca534bf8.css",
"/dist/homepage.daa70971.css"
]
},
Expand All @@ -16,10 +16,10 @@
"/dist/245.f9644c9e.js",
"/dist/383.82e9b159.js",
"/dist/814.47265ca3.js",
"/dist/main.774bb773.js"
"/dist/main.94d8f03a.js"
],
"css": [
"/dist/857.6650c424.css",
"/dist/857.ca534bf8.css",
"/dist/main.35f80290.css"
]
},
Expand Down
4 changes: 2 additions & 2 deletions _data/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dist/homepage.css": "/dist/homepage.daa70971.css",
"dist/homepage.js": "/dist/homepage.11d1d76a.js",
"dist/main.css": "/dist/main.35f80290.css",
"dist/main.js": "/dist/main.774bb773.js",
"dist/main.js": "/dist/main.94d8f03a.js",
"dist/adapter-flasher.js": "/dist/adapter-flasher.9e83994a.js",
"dist/adapter-noty.js": "/dist/adapter-noty.6ec70878.js",
"dist/adapter-notyf.js": "/dist/adapter-notyf.db901ffb.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
"dist/383.82e9b159.js": "/dist/383.82e9b159.js",
"dist/814.47265ca3.js": "/dist/814.47265ca3.js",
"dist/874.ec7ba3fe.js": "/dist/874.ec7ba3fe.js",
"dist/857.6650c424.css": "/dist/857.6650c424.css",
"dist/857.ca534bf8.css": "/dist/857.ca534bf8.css",
"dist/fonts/fa-duotone-900.ttf": "/dist/fonts/fa-duotone-900.7aaed888.ttf",
"dist/fonts/fa-thin-100.ttf": "/dist/fonts/fa-thin-100.e979819d.ttf",
"dist/fonts/fa-light-300.ttf": "/dist/fonts/fa-light-300.c92b45dd.ttf",
Expand Down
2 changes: 1 addition & 1 deletion _data/menu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<i class="fa-duotone fa-rocket"></i> Getting Started:
<i class="fa-duotone fa-book text-indigo-900 mr-1 fa-lg"></i> Introduction: '/'
# <i class="fa-duotone fa-download text-indigo-900 mr-1 fa-lg"></i> Installation: '/installation/'
# <i class="fa-brands fa-symfony fa-lg text-black mr-1"></i> Symfony: '/symfony/'
<i class="fa-brands fa-symfony fa-lg text-black mr-1"></i> Symfony: '/symfony/'
<i class="fa-brands fa-laravel fa-lg text-red-900 mr-1"></i> Laravel: '/laravel/'
<i class="fa-duotone fa-ghost fa-lg text-pink-800 mr-1"></i> Livewire: '/livewire/'
<i class="fa-duotone fa-angles-right fa-lg text-indigo-900 mr-1"></i> Inertia: '/inertia/'
Expand Down
10 changes: 5 additions & 5 deletions _includes/_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ composer require php-flasher/flasher-symfony

**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** includes a default notification style <i class="fa-duotone fa-comment-captions text-yellow-600"></i>, but users can also install additional adapters to customize the appearance of notifications within their projects such as :

* **[Toastr](/docs/adapter/toastr/)**
* **[Noty](/docs/adapter/noty/)**
* **[Notyf](/docs/adapter/notyf/)**
* **[Sweet Alert](/docs/adapter/sweetalert/)**
* **[Pnotify](/docs/adapter/pnotify/)**
* **[Toastr](/library/toastr/)**
* **[Noty](/library/noty/)**
* **[Notyf](/library/notyf/)**
* **[Sweet Alert](/library/sweetalert/)**
* **[Pnotify](/library/pnotify/)**

---

Expand Down
28 changes: 14 additions & 14 deletions _includes/_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To display a notification message, you can either use the `flash()` helper method or obtain an instance of `flasher` from the service container.
Then, before returning a view or redirecting, call the `addSuccess()` method and pass in the desired message to be displayed.

{% assign id = '# PHPFlasher' %}
{% assign id = '#/ PHPFlasher' %}
{% assign type = 'success' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand Down Expand Up @@ -53,7 +53,7 @@ but you may want to tailor it to fit the specific context and language of your a

> Using this package is actually pretty easy. Adding notifications to your application actually require only one line of code.
{% assign id = '# usage addSuccess' %}
{% assign id = '#/ usage addSuccess' %}
{% assign type = 'success' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -65,7 +65,7 @@ but you may want to tailor it to fit the specific context and language of your a
flash()->add{{ type | capitalize }}('{{ message }}');
```

{% assign id = '# usage addError' %}
{% assign id = '#/ usage addError' %}
{% assign type = 'error' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -77,7 +77,7 @@ flash()->add{{ type | capitalize }}('{{ message }}');
flash()->add{{ type | capitalize }}('{{ message }}');
```

{% assign id = '# usage addWarning' %}
{% assign id = '#/ usage addWarning' %}
{% assign type = 'warning' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -89,7 +89,7 @@ flash()->add{{ type | capitalize }}('{{ message }}');
flash()->add{{ type | capitalize }}('{{ message }}');
```

{% assign id = '# usage addInfo' %}
{% assign id = '#/ usage addInfo' %}
{% assign type = 'info' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -103,14 +103,14 @@ flash()->add{{ type | capitalize }}('{{ message }}');

---

These four methods (`addSuccess`, `addError`, `addWarning`, `addInfo`) are simply convenience shortcuts for the `addFlash` method,
allowing you to specify the `type` and `message` in a single method call rather than having to pass both as separate arguments to the `addFlash` method.
These four methods `addSuccess()`, `addError()`, `addWarning()`, `addInfo()` are simply convenience shortcuts for the `addFlash()` method,
allowing you to specify the `type` and `message` in a single method call rather than having to pass both as separate arguments to the `addFlash()` method.

```php
flash()->addFlash(string $type, string $message, string $title = null, array $options = [])
```

{% assign id = '# usage addFlash' %}
{% assign id = '#/ usage addFlash' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand Down Expand Up @@ -148,7 +148,7 @@ flash()->options(array $options, bool $merge = true);

> Refer to the documentation for your chosen JavaScript library to see which options are available and how they should be formatted.
{% assign id = '# usage options' %}
{% assign id = '#/ usage options' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{"timeout": 3000, "position": "top-center"}' %}
Expand Down Expand Up @@ -180,7 +180,7 @@ Set a single option by specifying its name and value as separate arguments.
flash()->option(string $option, mixed $value);
```

{% assign id = '# usage option' %}
{% assign id = '#/ usage option' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{"timeout": 3000, "position": "top-center"}' %}
Expand Down Expand Up @@ -210,7 +210,7 @@ Sets the priority of a flash message, the highest priority will be displayed fir
flash()->priority(int $priority);
```

{% assign id = '# usage priority' %}
{% assign id = '#/ usage priority' %}
{% assign successMessage = site.data.messages['success'] | sample | prepend: 'Priority 3 → ' %}
{% assign errorMessage = site.data.messages['error'] | sample | prepend: 'Priority 1 → ' %}
{% assign warningMessage = site.data.messages['warning'] | sample | prepend: 'Priority 4 → ' %}
Expand Down Expand Up @@ -277,7 +277,7 @@ This method sets the number of requests that the flash message should persist fo

As an example, with a multi-page form, you may want to store messages until all pages have been filled.

{% assign id = '# usage hops' %}
{% assign id = '#/ usage hops' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand Down Expand Up @@ -308,7 +308,7 @@ the flash message will be translated into the specified language. If null is pro
flash()->translate(string $locale = null);
```

{% assign id = '# usage translate' %}
{% assign id = '#/ usage translate' %}
{% assign type = 'success' %}
{% assign message = 'تمت العملية بنجاح.' %}
{% assign title = 'تهانينا' %}
Expand All @@ -323,7 +323,7 @@ flash()
->add{{ type | capitalize }}('Your request was processed successfully.', 'Congratulations!');
```

{% assign id = '# usage translate with position' %}
{% assign id = '#/ usage translate with position' %}
{% assign type = 'success' %}
{% assign message = 'تمت العملية بنجاح.' %}
{% assign title = 'تهانينا' %}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/_tryit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const codeBlocks = document.querySelectorAll("pre > code");

codeBlocks.forEach(function (codeBlock) {
const code = codeBlock.innerText.trim();
if (!code.startsWith("#")) {
if (!code.startsWith("#/")) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/857.6650c424.css → dist/857.ca534bf8.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main.774bb773.js → dist/main.94d8f03a.js

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions docs/concepts/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Usage

Using this package is actually pretty easy. Adding notifications to your application actually require only one line of code.

{% assign id = '# usage addSuccess' %}
{% assign id = '#/ usage addSuccess' %}
{% assign type = 'success' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -19,7 +19,7 @@ Using this package is actually pretty easy. Adding notifications to your applica
flash()->add{{ type | capitalize }}('{{ message }}');
```

{% assign id = '# usage addError' %}
{% assign id = '#/ usage addError' %}
{% assign type = 'error' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -31,7 +31,7 @@ flash()->add{{ type | capitalize }}('{{ message }}');
flash()->add{{ type | capitalize }}('{{ message }}');
```

{% assign id = '# usage addWarning' %}
{% assign id = '#/ usage addWarning' %}
{% assign type = 'warning' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -43,7 +43,7 @@ flash()->add{{ type | capitalize }}('{{ message }}');
flash()->add{{ type | capitalize }}('{{ message }}');
```

{% assign id = '# usage addInfo' %}
{% assign id = '#/ usage addInfo' %}
{% assign type = 'info' %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -64,7 +64,7 @@ allowing you to specify the `type` and `message` in a single method call rather
flash()->addFlash(string $type, string $message, string $title = null, array $options = [])
```

{% assign id = '# usage addFlash' %}
{% assign id = '#/ usage addFlash' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand Down Expand Up @@ -102,7 +102,7 @@ flash()->options(array $options, bool $merge = true);

> Refer to the documentation for your chosen JavaScript library to see which options are available and how they should be formatted.
{% assign id = '# usage options' %}
{% assign id = '#/ usage options' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{"timeout": 3000, "position": "top-center"}' %}
Expand Down Expand Up @@ -134,7 +134,7 @@ Set a single option by specifying its name and value as separate arguments.
flash()->option(string $option, mixed $value);
```

{% assign id = '# usage option' %}
{% assign id = '#/ usage option' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{"timeout": 3000, "position": "top-center"}' %}
Expand Down Expand Up @@ -162,7 +162,7 @@ flash()
flash()->priority(int $priority);
```

{% assign id = '# usage priority' %}
{% assign id = '#/ usage priority' %}
{% assign successMessage = site.data.messages['success'] | sample | prepend: 'Priority 3 → ' %}
{% assign errorMessage = site.data.messages['error'] | sample | prepend: 'Priority 1 → ' %}
{% assign warningMessage = site.data.messages['warning'] | sample | prepend: 'Priority 4 → ' %}
Expand Down Expand Up @@ -227,7 +227,7 @@ flash()

Sometimes you may want a flash message to persist for longer than a single request. As an example, with a multi-page form, you may want to store messages until all pages have been filled.

{% assign id = '# usage hops' %}
{% assign id = '#/ usage hops' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand Down Expand Up @@ -255,7 +255,7 @@ flash()
flash()->keep();
```

{% assign id = '# usage keep' %}
{% assign id = '#/ usage keep' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -279,7 +279,7 @@ flash()
flash()->delay(int $delay);
```

{% assign id = '# usage delay' %}
{% assign id = '#/ usage delay' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -303,7 +303,7 @@ flash()
flash()->now();
```

{% assign id = '# usage now' %}
{% assign id = '#/ usage now' %}
{% assign type = site.data.messages.types | sample %}
{% assign message = site.data.messages[type] | sample %}
{% assign options = '{}' %}
Expand All @@ -327,7 +327,7 @@ flash()
flash()->translate(string $locale = null);
```

{% assign id = '# usage translate' %}
{% assign id = '#/ usage translate' %}
{% assign type = 'success' %}
{% assign message = 'تمت العملية بنجاح.' %}
{% assign title = 'تهانينا' %}
Expand All @@ -342,7 +342,7 @@ flash()
->add{{ type | capitalize }}('Your request was processed successfully.', 'Congratulations!');
```

{% assign id = '# usage translate with position' %}
{% assign id = '#/ usage translate with position' %}
{% assign type = 'success' %}
{% assign message = 'تمت العملية بنجاح.' %}
{% assign title = 'تهانينا' %}
Expand Down
22 changes: 11 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Flash notifications serves as a feedback & confirmation mechanism after the user
## <i class="fa-duotone fa-list-radio"></i> Why use **<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** ?

**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** supports popular notification libraries :
<span class="text-indigo-900">[__toastr.js__](/docs/adapter/toastr/)</span>,
<span class="text-indigo-900">[__sweetalert 2__](/docs/adapter/sweetalert/)</span>,
<span class="text-indigo-900">[__pnotify__](/docs/adapter/pnotify/)</span>,
<span class="text-indigo-900">[__noty__](/docs/adapter/noty/)</span>,
<span class="text-indigo-900">[__notyf__](/docs/adapter/notyf/)</span> and even show <span class="text-indigo-900">__desktop__</span> notifications.
<span class="text-indigo-900">[__toastr.js__](/library/toastr/)</span>,
<span class="text-indigo-900">[__sweetalert 2__](/library/sweetalert/)</span>,
<span class="text-indigo-900">[__pnotify__](/library/pnotify/)</span>,
<span class="text-indigo-900">[__noty__](/library/noty/)</span>,
<span class="text-indigo-900">[__notyf__](/library/notyf/)</span> and even show <span class="text-indigo-900">__desktop__</span> notifications.

You have a wide range of options to choose from to suit your specific needs. Whether you want to display simple toast messages or more sophisticated alerts,
**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** has you covered.
Expand All @@ -87,9 +87,9 @@ Give it a try and see the difference it can make for yourself!

## <i class="fa-duotone fa-list-radio"></i> Getting Started

* **[Installation](/docs/installation/)**
* **[Toastr](/docs/adapter/toastr/)**
* **[Noty](/docs/adapter/noty/)**
* **[Notyf](/docs/adapter/notyf/)**
* **[Sweet Alert](/docs/adapter/sweetalert/)**
* **[Pnotify](/docs/adapter/pnotify/)**
* **[Installation](/installation/)**
* **[Toastr](/library/toastr/)**
* **[Noty](/library/noty/)**
* **[Notyf](/library/notyf/)**
* **[Sweet Alert](/library/sweetalert/)**
* **[Pnotify](/library/pnotify/)**
Loading

0 comments on commit 77c77b1

Please sign in to comment.