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
Copy file name to clipboardExpand all lines: docs/guide/commands.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,18 +169,18 @@ Here is the full list of available methods:
169
169
170
170
### Command return types
171
171
172
-
Finally, let's review the return possibilities: after a Command has been executed, the code must return something to tell to the front what to do next. There are height of them:
172
+
Finally, let's review the return possibilities: after a Command has been executed, the code must return something to tell to the front what to do next. There are eight of them:
173
173
174
-
-`return $this->info('some text', reload: true)`: displays the entered text in a modal. The second argument, optional (default is `false`), is a boolean to also mark Sharp to reload the page.
174
+
-`return $this->info(string $message, bool $reload = false)`: displays the entered text in a modal. The second argument allows reloading the page first.
175
175
-`return $this->reload()`: reload the current page (with context).
176
-
-`return $this->refresh(1)`*: refresh only the instance with an id on `1`. We can pass an id array also to refresh more than one instance.
177
-
-`return $this->view('view.name', ['some'=>'params'])`: display a view right in Sharp; useful for page previews.
178
-
-`return $this->html('...')`: display an HTML content.
179
-
-`return $this->link('/path/to/redirect')`: redirect to the given path.
180
-
-`return $this->download('path', 'diskName')`: the browser will download the specified file.
181
-
-`return $this->streamDownload('path', 'name')`: the browser will stream the specified file.
182
-
183
-
\*`refresh()` is only useful in an Entity List case (in a Dashboard or a Show Page, it will be treated as a `reload()`). In order to make it work properly, you have to slightly adapt the `getListData()` of your Entity List implementation, making use of `$this->queryParams->specificIds()`:
176
+
-`return $this->refresh(mixed $ids)`*: refresh only instance(s) with an id in `$ids`, which can be either a single id or an array.
177
+
-`return $this->view(string $bladeView, array $params = [])`: display a view right in Sharp; useful for page previews.
178
+
-`return $this->html(string $htmlContent)`: display an HTML content.
179
+
-`return $this->link(string $link, bool $openInNewTab = false)`: redirect to the given path. The second argument, optional (default is `false`), is a boolean to open the link in a new tab.
180
+
-`return $this->download(string $filePath, ?string $fileName = null, ?string $diskName = null)`: the browser will download the specified file.
181
+
-`return $this->streamDownload(string $fileContent, string $fileName)`: the browser will stream the specified file.
182
+
183
+
\*`refresh()` is only useful in an Entity List case (in a Dashboard or a Show Page, it will be treated as a `reload()`). To make it work properly, you have to slightly adapt the `getListData()` of your Entity List implementation, making use of `$this->queryParams->specificIds()`:
0 commit comments