Download the PHP package userfrosting/vite-php-twig without Composer

On this page you can find all versions of the php package userfrosting/vite-php-twig. 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 vite-php-twig

Vite Manifest Support for PHP & Twig

Version PHP Version Build Codecov StyleCI PHPStan Donate

Vite Manifest function for PHP & Twig Templates. Allows Vite manifest integration in PHP & Twig Templates without Symfony. Optimized for PHP-DI style containers.

Inspired by kellerkinderDE/vite-encore-bundle & PHP-Vite.

Installation

Documentation & Usage

Using standalone

ViteManifest implements \UserFrosting\ViteTwig\ViteManifestInterface if you prefer to type-hint against interfaces, for use with dependency injection.

Using with Twig

Requires Twig 3 or newer

Vite writes an manifest.json file that contains all of the files needed for each "entry". To reference entries in Twig, you need to add the ViteTwigExtension extension to the Twig Environment. This accept a ViteManifest, which itself accept the path to the manifest.json,

Now, to render all of the script and link tags for a specific "entry" (e.g. entry1), you can:

If you have multiple entry point scripts on the same page, you should pass them in a single call to avoid duplicates - for example:

Vite default port

By default, vite will use port 5173. However, if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on. Since a PHP application doesn't know which port is being used by vite, the port can be forced in the vite.config.js file inside your project's root directory using server.strictPort and server.port :

For more information on how to configure Vite, see the official documentation.

ViteManifest Options

manifestPath - string

Points to the Vite manifest.json file created for the production build.. Optional if you're using the dev server

basePath - string

Public base path from which Vite's published assets are served. The assets paths will be relative to the outDir in your vite configuration. It could also point to a CDN or other asset server, if you are serving assets from a different domain.

serverUrl - string

The vite server url, including port. Can be used to specify a non-default port if used.

devEnabled - bool

Indicates whether the application is running in development mode (i.e. using vite server). Defaults to false.

See Also

References


All versions of vite-php-twig with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
twig/twig Version ^3.3
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 userfrosting/vite-php-twig contains the following files

Loading the files please wait ....