File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1004,6 +1004,29 @@ public function dontSeeAuthentication($remembered = true)
10041004 );
10051005 }
10061006
1007+ /**
1008+ * Grabs a Symfony parameter
1009+ *
1010+ * ```php
1011+ * <?php
1012+ * $I->grabParameter('app.business_name');
1013+ * ```
1014+ *
1015+ * @param string $name
1016+ * @return mixed|null
1017+ */
1018+ public function grabParameter ($ name )
1019+ {
1020+ $ container = $ this ->_getContainer ();
1021+
1022+ if (!$ container ->has ('parameter_bag ' )) {
1023+ $ this ->fail ("Symfony container doesn't have 'parameter_bag' service " );
1024+ return null ;
1025+ }
1026+ $ parameterBag = $ this ->grabService ('parameter_bag ' );
1027+ return $ parameterBag ->get ($ name );
1028+ }
1029+
10071030 /**
10081031 * Checks that current page matches action
10091032 *
You can’t perform that action at this time.
0 commit comments