File tree 1 file changed +38
-1
lines changed
1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ import TabItem from '@theme/TabItem';
9
9
groupId = " language"
10
10
defaultValue = " js"
11
11
values = { [
12
- { label: ' JavaScript' , value: ' js' , }
12
+ { label: ' JavaScript' , value: ' js' , },
13
+ { label: ' PHP' , value: ' php' , }
13
14
]
14
15
} >
15
16
<TabItem value = " js" >
@@ -111,5 +112,41 @@ const res = await personalizationClient.getUserTokenProfile({
111
112
console .log (' [Results]' , res);
112
113
```
113
114
115
+ </TabItem >
116
+
117
+ <TabItem value = " php" >
118
+
119
+ ## Installation
120
+
121
+ First, install Algolia PHP API Client via the composer package manager:
122
+ ``` bash
123
+ composer require algolia/algoliasearch-client-php
124
+ ```
125
+ ## Using the client
126
+
127
+ Then, create objects on your index:
128
+ ``` php
129
+ $client = Algolia\AlgoliaSearch\Api\SearchClient::create(
130
+ '<YOUR _APP_ID >',
131
+ '<YOUR _API_KEY >'
132
+ );
133
+
134
+ $client->saveObject('<YOUR _INDEX >', ['objectID' => 1, 'name' => 'Foo']);
135
+ ```
136
+
137
+ Finally, you may begin searching an object using the ` search ` method:
138
+ ``` php
139
+ $objects = $client->search('<YOUR _INDEX >', ['query' => 'Foo']);
140
+ ```
141
+
142
+ Another example with the personalization client:
143
+ ``` php
144
+ $client = Algolia\AlgoliaSearch\Api\PersonalizationClient::create(
145
+ '<YOUR _APP_ID >',
146
+ '<YOUR _API_KEY >'
147
+ );
148
+
149
+ $res = $client->getUserTokenProfile('<YOUR _TOKEN >');
150
+ ```
114
151
</TabItem >
115
152
</Tabs >
You can’t perform that action at this time.
0 commit comments