You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -130,37 +150,33 @@ public function run($sort_by, $sort_order) { }
130
150
131
151
`run()` method is resolved via Laravel service container so method injection is available here too.
132
152
133
-
###Namespaces configuration
153
+
## Namespaces
134
154
135
-
By default package tries to find your widget in the ```App\Widgets``` namespace.
155
+
By default the package tries to find your widget in the ```App\Widgets``` namespace.
136
156
137
157
You can overwrite this by publishing package config and setting `default_namespace` property.
138
158
139
-
Although using the default namespace is very convenient and keeps you from doing unnecessary actions, in some situations you may wish to have more flexibility.
159
+
Although using the default namespace is very convenient, in some situations you may wish to have more flexibility.
140
160
For example, if you've got dozens of widgets it makes sense to group them in namespaced folders.
141
161
142
-
You actually have several ways to call those widgets:
162
+
You have two ways to call those widgets:
143
163
144
-
1) You can pass the full name to the `run` method.
164
+
1) You can pass the full widget name to the `run` method.
145
165
```php
146
166
@widget('News\RecentNews', $config)
167
+
{!! Widget::run('News\RecentNews', $config) !!}
147
168
```
148
169
149
170
2) You can use dot notation instead.
150
171
```php
151
172
@widget('news.recentNews', $config)
173
+
{!! Widget::run('news.recentNews', $config) !!}
152
174
```
153
175
154
-
3) Finally, you can register a widget in package config like that.
0 commit comments