Download the PHP package pieceofcake2/webpack-encore without Composer

On this page you can find all versions of the php package pieceofcake2/webpack-encore. 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 webpack-encore

CakePHP 2.x Webpack Encore Plugin

Packagist Version PHP CakePHP Tests Codecov

This helper allows you to integrate Symfony Webpack Encore–built assets (CSS, JS, images) into a CakePHP 2 application. It reads entrypoints.json and manifest.json to resolve fingerprinted asset filenames and output proper <link>, <script>, or <img> tags.

Installation

  1. Install plugin:

  2. Build your Encore assets (e.g., with Symfony Encore or webpack). From your project root, run:

    This should generate:

    • webroot/build/entrypoints.json
    • webroot/build/manifest.json
    • The webroot/build/ directory containing compiled .js, .css, and image files.
  3. Copy EncoreHelper.php into your CakePHP app under:

  4. Load the helper in your controller (e.g., AppController):

    Now you can use $this->Encore in your views.


Configuration (Configure)

By default, the helper expects:

If you store these files in different locations, add the following to app/Config/bootstrap.php:

Replace the paths accordingly if they differ.


Helper Methods

1. asset($assetPath)

Resolves a single logical asset path (as a key in manifest.json) to the final fingerprinted URL. Returns a web-accessible path (including leading slash).

2. image($assetPath, array $htmlAttributes = [])

Renders an <img> tag for a given image asset by resolving through manifest.json.

3. css($assetPaths, array $options = [])

Renders one or more <link> tags for CSS assets. The first argument can be a string or an array of strings. Each path is resolved via manifest.json, then passed to HtmlHelper::css().

4. script($assetPaths, array $options = [])

Renders one or more <script> tags for JavaScript assets. Accepts a string or an array of strings. Each is resolved via manifest.json, then passed to HtmlHelper::script().

5. entryLinkTags($entryName, array $options = [])

Reads entrypoints.json and renders <link> tags for all CSS files associated with the given entry (e.g., app, dashboard).

6. entryScriptTags($entryName, array $options = [])

Reads entrypoints.json and renders <script> tags for all JS files associated with the given entry.

Example Layout Integration

In app/View/Layouts/default.ctp:

Notes

License

This plugin is released under the MIT License. You are free to adapt and redistribute it in compliance with the license.


All versions of webpack-encore with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
composer/installers Version ^1.0 || ^2.0
pieceofcake2/cakephp Version ^2.12
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 pieceofcake2/webpack-encore contains the following files

Loading the files please wait ...