Skip to content

Commit 154dfa6

Browse files
author
Leny BERNARD
committed
📝 rename troopers_alertifybundle.helper.alertifyhelper service to simpler alertify and update readme
1 parent 7fe9eef commit 154dfa6

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

Controller/AlertifyControllerTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trait AlertifyControllerTrait
1818
*/
1919
public function alert($content, $type = 'success', $options = [])
2020
{
21-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->alert($content, $type, $options);
21+
$this->container->get('alertify')->alert($content, $type, $options);
2222
}
2323

2424
/**
@@ -29,7 +29,7 @@ public function alert($content, $type = 'success', $options = [])
2929
*/
3030
public function congrat($content, $options = [])
3131
{
32-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->congrat($content, $options);
32+
$this->container->get('alertify')->congrat($content, $options);
3333
}
3434

3535
/**
@@ -40,7 +40,7 @@ public function congrat($content, $options = [])
4040
*/
4141
public function warn($content, $options = [])
4242
{
43-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->warn($content, $options);
43+
$this->container->get('alertify')->warn($content, $options);
4444
}
4545

4646
/**
@@ -51,7 +51,7 @@ public function warn($content, $options = [])
5151
*/
5252
public function inform($content, $options = [])
5353
{
54-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->inform($content, $options);
54+
$this->container->get('alertify')->inform($content, $options);
5555
}
5656

5757
/**
@@ -62,6 +62,6 @@ public function inform($content, $options = [])
6262
*/
6363
public function scold($content, $options = [])
6464
{
65-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->scold($content, $options);
65+
$this->container->get('alertify')->scold($content, $options);
6666
}
6767
}

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,15 @@ troopers_alertify:
105105
How to ?
106106
------------
107107

108-
It's easy to use, just follow the following:
109-
110-
Add this block at the end of your twig layout:
111-
112-
{% block alertify %}
113-
{{ app.session|alertify|raw }}
114-
{% endblock %}
115-
116-
Now, anywhere, you can put your alert in the flash session and enjoy.
117-
118108
$this->get('session')->getFlashBag()->add('success', 'ok');
119109
$this->get('session')->getFlashBag()->add('warning', array('body' => 'ok', 'context' => 'front', 'options' => ['option1' => 'custom value']);
120110

121-
You can use the `troopers_alertifybundle.helper.alertifyhelper` service to ease the alert creation :
111+
You can use the `alertify` service to ease the alert creation :
122112

123-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->congrat('TEST', $options);
124-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->warn('TEST', $options);
125-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->inform('TEST', $options);
126-
$this->container->get('troopers_alertifybundle.helper.alertifyhelper')->scold('TEST', $options);
113+
$this->container->get('alertify')->congrat('TEST', $options);
114+
$this->container->get('alertify')->warn('TEST', $options);
115+
$this->container->get('alertify')->inform('TEST', $options);
116+
$this->container->get('alertify')->scold('TEST', $options);
127117

128118
You can also use the AlertifyControllerTrait to have simple methods in controller :
129119

Resources/config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parameters>
1212

1313
<services>
14-
<service id="troopers_alertifybundle.helper.alertifyhelper" class="%alertify.helper.class%">
14+
<service id="alertify" class="%alertify.helper.class%">
1515
<argument type="service" id="session" />
1616
</service>
1717
<service id="troopers_alertifybundle.session_handler" class="%alertify.handler.session.class%">

0 commit comments

Comments
 (0)