Download the PHP package silarhi/turbo-bundle without Composer

On this page you can find all versions of the php package silarhi/turbo-bundle. 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 turbo-bundle

Turbo Bundle

Framework-agnostic Hotwire Turbo lifecycle helpers, split in two reusable halves:

The two halves implement opposite ends of the same redirect-following contract, but each is usable on its own.

Installation

JavaScript — TurboHandler

Options

Option Type Default Purpose
onMount (container: Element \| Document) => void Init your listeners on a freshly rendered / inserted element.
onUnmount (container: Element \| Document) => void Tear them down before the element leaves the DOM.
getContainer (document: Document) => Element document.body Root element a full Drive render mounts on.
onRedirect (url: string) => void Turbo.visit(url) Follow a server Turbo-Location redirect.
streamMutations boolean true Diff the DOM around each Turbo Stream render and mount/unmount the nodes it touched.
morphMutations boolean false Handle Drive/Frame morph renders per-node via turbo:morph-element instead of re-initializing the whole container.

streamMutations (the "morph" switch)

By default the handler observes the DOM around every turbo:before-stream-render, then mounts the nodes a Stream inserted and unmounts the ones it removed. It is morph-aware: a reused node may be reported as both removed and added, and the policy is mount-wins (never unmount-then-remount, never double-mount). Pass streamMutations: false to opt out and keep stock Turbo behaviour.

morphMutations (Drive & Frame morphs)

streamMutations covers Turbo Stream morphs (<turbo-stream method="morph">). The other two morph paths — Drive page refresh (<meta name="turbo-refresh-method" content="morph">) and frame refresh (<turbo-frame refresh="morph">) — fire turbo:before-render/turbo:before-frame-render with renderMethod: "morph" and morph the container in place. By default the handler treats them like a replace: it unmounts then re-mounts the whole container, re-initializing listeners even on the nodes the morph preserved.

Set morphMutations: true to instead skip that coarse re-init on morph renders and refresh only the nodes Turbo actually morphed, via the turbo:morph-element event — leaving preserved widgets (an open select, a focused field) untouched. Scope: it covers elements morphed in place; subtrees a morph adds or removes wholesale aren't re-mounted by this path. It requires onMount/onUnmount to be safe to call on an individual element.

PHP — frame-redirect following

Full Symfony application

Register the optional bundle for zero-config service wiring:

TurboManager and TurboFrameListener are now registered (the listener is tagged kernel.event_subscriber automatically), plus the turbo_frame Twig filter when Twig is installed.

Configure it (default values shown):

turbo_frame Twig filter

Render a full template on a normal request, but a lean frame template when the request targets a (matching) Turbo Frame — without branching in every action:

When the frame matches and you don't pass a base template, the filter first looks for a -frame sibling of the template (project/show.html.twigproject/show-frame.html.twig). If that template exists it wins; otherwise the filter falls back to the configured base_template. Passing an explicit base template skips the sibling lookup entirely.

Omit the frame id ('project/show.html.twig'|turbo_frame) to match any Turbo Frame request.

Without the framework (components only)

TurboFrameListener also follows DELETE redirects on Turbo requests by default; pass new TurboFrameListener($turboManager, followDeleteRedirects: false) to disable that.

Development

License

MIT © SILARHI


All versions of turbo-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/event-dispatcher Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^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 silarhi/turbo-bundle contains the following files

Loading the files please wait ...