Download the PHP package cambis/silverstripe-inertia without Composer

On this page you can find all versions of the php package cambis/silverstripe-inertia. 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 silverstripe-inertia

Inertia.js Silverstripe adapter

Inertia.js adapter for Silverstripe, based on inertia-bundle.

Visit inertiajs.com to learn more.

Getting started

Install the server adapter.

Install the preferred client adapter.

React

Vue

Svelte

Configuration

Here is a basic configuration to get started with.

Server-side

First, configure your Silverstripe application with the following:

Config file

Create a config file:

Template

In your root Page.ss template, add:

The root template location is optionally configurable:

PageController

Configure your PageController class to serve Inertia.

If your IDE supports the @mixin directive, add it to your PageController for autocomplete:

Alternatively, you can use the @property directive:

Client-side

Once your Silverstripe application is setup, you can configure the client application.

React

Vue

Svelte

Lazy data evaluation

Sometimes you don't want to re-evaluate data when making visits to the same page type. This can be accomplised server-side by using a callback function or lazy().

Check the offical documentation for client side configuration.

Sharing data

You can share props between all components using the $this->inertia->share(string, mixed) function. One use case is populating the navigation menu for a website, this can be accomplished using a SilverStripe\Core\Extension.

View data

You can pass data to your root Silverstripe template via the render() parameter in the render function:

You can also pass data using the $this->inertia->viewData(string, mixed) function:

Data is accessible using the $ViewData variable

Asset versioning

By default, the middleware checks for the config variables asset_url and manifest_file to get the current asset version.

You can specify your application's asset version by extending the Cambis\Inertia\Control\Middleware\InertiaMiddleware class.

Don't forget to update your configuration if you do this!

Alternatively, you can use the $this->inertia->version(mixed) function to set the current asset version

Cache busting

Check the offical documentation for information on cache busting.

Server-side rendering

To enable server-side rendering, first enable the following config variables ssr_enabled and ssr_host:

Check the official documentation for information on client-side setup.

Demo

You can find a basic demo here


All versions of silverstripe-inertia with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.7
silverstripe/framework Version ^4.0 || ^5.0
php Version ^7.4 || ^8.0
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 cambis/silverstripe-inertia contains the following files

Loading the files please wait ...