File tree Expand file tree Collapse file tree 2 files changed +6
-38
lines changed Expand file tree Collapse file tree 2 files changed +6
-38
lines changed Original file line number Diff line number Diff line change 1111 ],
1212 "homepage" : " https://github.com/Arrilot/laravel-widgets" ,
1313 "require" : {
14- "php" : " >=5.4.0 " ,
15- "illuminate/support" : " 5.* " ,
16- "illuminate/contracts" : " 5.* " ,
17- "illuminate/view" : " 5.* " ,
18- "illuminate/container" : " 5.* " ,
19- "illuminate/console" : " 5.* "
14+ "php" : " >=5.5.9 " ,
15+ "illuminate/support" : " >=5.1 " ,
16+ "illuminate/contracts" : " >=5.1 " ,
17+ "illuminate/view" : " >=5.1 " ,
18+ "illuminate/container" : " >=5.1 " ,
19+ "illuminate/console" : " >=5.1 "
2020 },
2121 "require-dev" : {
2222 "phpunit/phpunit" : " ~4.0"
Original file line number Diff line number Diff line change @@ -74,9 +74,6 @@ public function boot()
7474 return "<?php echo app('arrilot.widget')->run {$ expression }; ?> " ;
7575 });
7676
77- // Blade::directive cannot recognize @async-widget, so @async-widget still use the custom matcher.
78- $ this ->registerBladeDirective ('async-widget ' , '$1<?php echo app("arrilot.async-widget")->run$2; ?> ' );
79-
8077 Blade::directive ('asyncWidget ' , function ($ expression ) {
8178 return "<?php echo app('arrilot.async-widget')->run {$ expression }; ?> " ;
8279 });
@@ -95,33 +92,4 @@ public function provides()
9592 {
9693 return ['arrilot.widget ' , 'arrilot.async-widget ' ];
9794 }
98-
99- /**
100- * Register a blade directive.
101- *
102- * @param $name
103- * @param $expression
104- */
105- protected function registerBladeDirective ($ name , $ expression )
106- {
107- Blade::extend (function ($ view ) use ($ name , $ expression ) {
108- $ pattern = $ this ->createMatcher ($ name );
109-
110- return preg_replace ($ pattern , $ expression , $ view );
111- });
112- }
113-
114- /**
115- * Substitution for $compiler->createMatcher().
116- *
117- * Get the regular expression for a generic Blade function.
118- *
119- * @param string $function
120- *
121- * @return string
122- */
123- protected function createMatcher ($ function )
124- {
125- return '/(?<!\w)(\s*)@ ' .$ function .'(\s*\(.*\))/ ' ;
126- }
12795}
You can’t perform that action at this time.
0 commit comments