File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,31 @@ public function handleContent(array $menus = [], bool $child = false)
4949 $ this ->defaultGenerate ($ menu );
5050 }
5151
52+ $ this ->handlerOlders ($ menu );
53+
5254 return $ menu ;
5355 }, $ menus );
5456 }
5557
58+ /**
59+ * Handles olders attributes
60+ *
61+ * @param object $menu
62+ * @return void
63+ */
64+ private function handlerOlders ($ menu )
65+ {
66+ $ pattern = '/\#.*?\#/ ' ;
67+ preg_match_all ($ pattern , $ this ->content , $ result );
68+
69+ foreach ($ result [0 ] as $ key => $ value ) {
70+ $ search = $ value ;
71+ $ replace = str_replace ('# ' , '' , $ value );
72+
73+ $ this ->content = str_replace ($ search , $ menu [$ replace ], $ this ->content );
74+ }
75+ }
76+
5677 /**
5778 * Replace default values
5879 *
Original file line number Diff line number Diff line change @@ -49,10 +49,31 @@ public function handleContent(array $menus = [], bool $child = false)
4949 $ this ->defaultGenerate ($ menu );
5050 }
5151
52+ $ this ->handlerOlders ($ menu );
53+
5254 return $ menu ;
5355 }, $ menus );
5456 }
5557
58+ /**
59+ * Handles olders attributes
60+ *
61+ * @param object $menu
62+ * @return void
63+ */
64+ private function handlerOlders ($ menu )
65+ {
66+ $ pattern = '/\#.*?\#/ ' ;
67+ preg_match_all ($ pattern , $ this ->content , $ result );
68+
69+ foreach ($ result [0 ] as $ key => $ value ) {
70+ $ search = $ value ;
71+ $ replace = str_replace ('# ' , '' , $ value );
72+
73+ $ this ->content = str_replace ($ search , $ menu ->$ replace , $ this ->content );
74+ }
75+ }
76+
5677 /**
5778 * Replace default values
5879 *
You can’t perform that action at this time.
0 commit comments