Skip to content

.only(...props) ​

Only ​

The .only(...props) method allows you to extract information from the object delivered by PHP, including only the values you need as parameters. This will be useful when you don't want to load the entire content of the constant.

javascript
// Retrieve only the data passed as arguments in the Only method
// Remember to replace PHP2JS with the Alias you have used.
const post = PHP2JS.only('post');
// Retrieve only the data passed as arguments in the Only method
// Remember to replace PHP2JS with the Alias you have used.
const post = PHP2JS.only('post');

Released under the MIT License.