Skip to content

Commit 352dd26

Browse files
committed
Rename Requests API to Data API and actualize methods
1 parent ead7cfa commit 352dd26

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Writerside/boson.tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<toc-element topic="schemes-api.md" />
4141
<toc-element topic="scripts-api.md" />
4242
<toc-element topic="bindings-api.md" />
43-
<toc-element topic="requests-api.md" />
43+
<toc-element topic="data-api.md" />
4444
</toc-element>
4545
<toc-element topic="events.md" />
4646
</toc-element>

Writerside/topics/overview.topic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<a href="schemes-api.md" />
3838
<a href="scripts-api.md" />
3939
<a href="bindings-api.md" />
40-
<a href="requests-api.md" />
40+
<a href="data-api.md" />
4141
</secondary>
4242
</section-starting-page>
4343
</topic>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Requests API
1+
# Data API
22

33
This API should be used to receive arbitrary data from the client.
44

5-
The API is available in the `WebView::$requests` property.
5+
The API is available in the `WebView::$data` property.
66

77
```php
88
$app = new Boson\Application();
99

10-
$app->webview->requests; // Access to Requests API
10+
$app->webview->data; // Access to Data API
1111
```
1212

1313

@@ -21,7 +21,7 @@ $app = new Boson\Application();
2121

2222
$app->on(function (WebViewDomReady $e) use ($app): void {
2323

24-
var_dump($app->webview->requests->get('document.location'));
24+
var_dump($app->webview->data->get('document.location'));
2525

2626
// array:10 [
2727
// "ancestorOrigins" => []
@@ -48,9 +48,9 @@ is not yet available.
4848
<code-block lang="php">
4949
$app = new Boson\Application();
5050

51-
var_dump($app->webview->requests->get('document.location'));
51+
var_dump($app->webview->data->get('document.location'));
5252
//
53-
// Boson\WebView\Requests\Exception\UnprocessableRequestException:
53+
// Boson\WebView\Api\DataApi\Exception\UnprocessableRequestException:
5454
// Request "document.location" could not be processed
5555
// because application is not running
5656
//
@@ -62,15 +62,15 @@ WebView also provides a more convenient way (facade method <code>get()</code>)
6262
to get arbitrary data from document.
6363

6464
Just use <code>WebView::get()</code> instead of get method
65-
from <code>WebView::$requests</code>.
65+
from <code>WebView::$data</code>.
6666

6767
<p>&nbsp;</p>
6868

6969
<compare>
7070
<code-block lang="php">
7171
$js = 'document.location';
7272

73-
$webview->requests->get($js);
73+
$webview->data->get($js);
7474
</code-block>
7575
<code-block lang="php">
7676
$js = 'document.location';
@@ -97,7 +97,7 @@ Such calls are less convenient, since they use
9797
```php
9898
$app = new Boson\Application();
9999

100-
$app->webview->requests->send('document.location')
100+
$app->webview->data->defer('document.location')
101101
->then(function ($data) {
102102
var_dump($data);
103103

0 commit comments

Comments
 (0)