Download the PHP package onpage-dev/onpage-php without Composer

On this page you can find all versions of the php package onpage-dev/onpage-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package onpage-php

On Page ® PHP library

With this library you can easy query your data using an On Page ® API token.

Installation

To install this library in your existing composer project, or update to the latest version, you can launch:

Of course, remember to include the composer autoload:

Usage

Setup

To start, you need to connect to an On Page Schema (project) using the following function:

Query your data

Filters and deletions

Get thing values

Use the val() function to get the first value in a field. Use the values() function to get all values in a field as a collection.

Files

For image and file fields, the returned value will be an instance of \OnPage\File::class. To get a file or image url use the ->link() function. The link will point to the original file.

To turn images into a thumbnail add an array of options as shown below:

Other utilities

Get thing relations

Creating and updating things

To create or update a record, you need to create a Thing Editor. There are two ways to get a Thing Editor:

  1. Using the Resource Writer
  2. Calling ->editor() on a Op\Thing

Using the Resource Writer (first method)

This class allows you to edit many records at once. You can easily obtain the editor calling:

Now that you have a Resource Writer, you can use it to create things:

...and to update existing things:

Finally, you need to send the request to the On Page server:

Updating a single item (second method)

Limiting modified languages

By default, even if you update a single language, the writer will delete the data on other languages. If you only need to edit certain languages and maintain the current values for the others, you can specify which languages you are working on as follows:

Updating translations

Just add the language code as the third argument to the set function:

Updating files

You can upload files to On Page using the FileUpload class:

Or you can also upload a file using a public URL:

Updating multivalue fields

For multivalue fields you only need to replace ->set with ->setValues and pass an array of values as the second argument:

Updating relations

To update relations, you can use the ->setRel(relation_name, related_ids):

Get structure information


All versions of onpage-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
guzzlehttp/guzzle Version ^7.9 || ^6.0
illuminate/collections Version ^8 || ^9 || ^10 || ^11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package onpage-dev/onpage-php contains the following files

Loading the files please wait ....