@@ -89,11 +89,11 @@ The last step is to call the widget.
8989You've actually got several ways to do so.
9090
9191``` php
92- {!! Widget::run('recentNews') !! }
92+ {{ Widget::run('recentNews') } }
9393```
9494or
9595``` php
96- {!! Widget::recentNews() !! }
96+ {{ Widget::recentNews() } }
9797```
9898or even
9999``` php
@@ -165,6 +165,8 @@ By default the package tries to find your widget in the ```App\Widgets``` namesp
165165
166166You can overwrite this by publishing package config and setting ` default_namespace ` property.
167167
168+ To publish config use: ``` php artisan vendor:publish --provider="Arrilot\Widgets\ServiceProvider" ```
169+
168170Although using the default namespace is very convenient, in some situations you may wish to have more flexibility.
169171For example, if you've got dozens of widgets it makes sense to group them in namespaced folders.
170172
@@ -173,21 +175,23 @@ You have two ways to call those widgets:
1731751 ) You can pass the full widget name from the ` default_namespace ` (basically ` App\Widgets ` ) to the ` run ` method.
174176``` php
175177@widget('News\RecentNews', $config)
176- {!! Widget::run('News\RecentNews', $config) !! }
178+ {{ Widget::run('News\RecentNews', $config) } }
177179```
178180
1791812 ) You can use dot notation instead.
180182``` php
181183@widget('news.recentNews', $config)
182- {!! Widget::run('news.recentNews', $config) !! }
184+ {{ Widget::run('news.recentNews', $config) } }
183185```
184186
185- Note: you can pass FQCN too.
187+ You can pass FQCN too.
186188``` php
187189@widget('\App\Http\Some\Namespace\Widget', $config)
188- {!! Widget::run('\App\Http\Some\Namespace\Widget', $config) !! }
190+ {{ Widget::run('\App\Http\Some\Namespace\Widget', $config) } }
189191```
190192
193+ * Note: For Laravel 5.0.0 - 5.1.3 you must use ` {!! !!} ` tags instead of ` {{ }} ` *
194+
191195## Asynchronous widgets
192196
193197In some situations it can be very beneficial to load widget content with AJAX.
@@ -292,7 +296,7 @@ Widget::group('sidebar')->position(5)->addWidget(<the same arguments list as in
292296Widget::group('sidebar')->position(4)->addAsyncWidget(<the same arguments list as in run() method >);
293297
294298// display them in a view in the correct order
295- {!! Widget::group('sidebar')->display() !! }
299+ {{ Widget::group('sidebar')->display() } }
296300//or
297301@widgetGroup('sidebar')
298302```
0 commit comments