Download the PHP package frankfoerster/cakephp-asset without Composer

On this page you can find all versions of the php package frankfoerster/cakephp-asset. 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 cakephp-asset

cakephp-asset

Build Status Coverage Status Total Downloads Latest Stable Version

  1. Provides a CakePHP 3.x AssetHelper to selectively add last modified timestamps to css and js assets. CakePHP's implementation of Asset timestamps does not allow you to apply the behavior selectively to single files. Therefore I created this little Helper.

  2. Provides a CakePHP 3.x AssetFilter to request asset files from /src/Assets/*. For example if you delevop an app using requirejs, then you can enable the AssetFilter to request modules from /src/Assets/js/*. This enables you to hide your source files from the webroot of your application or plugin.

Installation

You can install this plugin into your CakePHP application using composer.

Run the following command

Configuration

You can load the plugin using the shell command:

Or you can manually add the loading statement in the config/boostrap.php file of your application:

Load the Helper

Load the AssetHelper in the src/View/AppView.php file of your application.

Use the AssetHelper in your Layout.

The last modified time of the asset files is automatically appended.

The methods provided are AssetHelper::css() and AssetHelper::js(). Both take up to three arguments:

  1. $path - The path to the asset relative to the webroot of your app or plugin.
  2. $plugin - Either false to link to an app asset, or the name of a plugin. (default false)
  3. $appendTimestamp - Whether to append a last modified timestamp to the url. (default true)

CSS

Linking the CSS file your_app/webroot/css/app.css

produces the following output:

JS

Linking the JS file your_app/webroot/js/app.js

produces the following output:

Linking Plugin Assets

Linking the JS file MyPlugin/webroot/js/plugin.js

produces the following output:

Linking Source Assets

To request assets from /src/Assets/* you have to enable the AssetFilter in config/bootstrap.php:

Then you can use the AssetHelper to request a source asset.

App

Linking the JS file your_app/src/Assets/js/app.js

produces the following output:

and the AssetFilter will then return the content of your_app/src/Assets/js/app.js.

Plugin

Linking the JS file MyPlugin/src/Assets/js/plugin.js

will procude the following output:

and the AssetFilter will then return the content of MyPlugin/src/Assets/js/plugin.js.

Important!

Linking of source assets is only enabled for Configure 'debug' => true.


All versions of cakephp-asset with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.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 frankfoerster/cakephp-asset contains the following files

Loading the files please wait ....