Download the PHP package handmadeweb/frosty without Composer

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

Frosty provides easy access to fetch Ajax content in Statamic.

Requirements

Installation

You can install the package via composer:

Copy the package config to your local config with the publish command:

Prepare for Usage

Native Method

If you aren't using Alpine Js in your application then you'll need to load handmadeweb/datafetcher.js in your footer, you can either do this manually, or via the provided helpers for Alpine: {{ frosty:scripts }}, Blade: @frostyScripts or PHP: \HandmadeWeb\Frosty\Frosty::scripts();

This method uses the native.blade.php view, you are free to override it in resources/vendor/frosty/, you will have access to the content, endpoint and mode variables.

Alpine.Js Method

If you are using Alpine.Js in your application then you may update your Frosty configuration to use Alpine.

This method uses the alpine.blade.php view, you are free to override it in resources/vendor/frosty/, you will have access to the content, endpoint and mode variables.

Custom Method

You are free to use a custom method, you may do so by defining a new view template for Frosty to use under resources/vendor/frosty, the filenames alpine, native and not-found are considered to be reserved, although you may override them if you wish.

Once you have created a new view for your mode, you will have access to the content, endpoint and mode variables, you may then use this to provide the content or endpoint to your custom method.

Then it is just a matter of updating the mode to use the name of your new method/view.

Lets say we created a file called myCustomVueMode.blade.php which might contain something like,

You would then update your mode to:

In the event that your custom method/mode doesn't have a corresponding view file, then Frosty will insert some HTML comments in the location of where it would have rendered your method.

Antlers Usage

Using Frosty in Antlers can be done by using the frosty tag or if you are using an .antlers.php template file by using the class (see class instructions)

You can use the tag as either frosty:fetch or just frosty, I like frosty:fetch a little more though as it describes what it is doing.

Pulling in content from a url.

The url can be anywhere.

Or

Pulling in content from a route.

Routes must be a GET route and cannot currently accept parameters.

Please note that the above three examples cannot be combined into a single tag call.

The first found parameter will be used, parameters are checked in the order: endpoint, url, route.

Using initial content then pulling new content.

This works with both the route and url options.

Using a different mode/view.

You are free to use any other mode/view that might be available for Frosty to use, separately to whatever you might have set as the config default. You can do this by passing the mode parameter, which will relate to the name of a view file located in resources/vendor/frosty/

Blade Usage

Using Frosty in Blade can be done by using the frosty blade directive or by using the class (see class instructions) The blade directive currently doesn't accept providing content or context, If you need to use that functionality the you'll need to use the class chaining method.

You can also use named arguments in PHP 8+ to specify particular parameters.

Pulling in content from a url.

Pulling in content from a route.

Using a different mode/view.

You are free to use any other mode/view that might be available for Frosty to use, separately to whatever you might have set as the config default. You can do this by passing the mode parameter, which will relate to the name of a view file located in resources/vendor/frosty/

Class Usage

New up the class.

Or use the make method.

You can also use named arguments in PHP 8+ to specify particular parameters.

You are free to use any other mode/view that might be available for Frosty to use, separately to whatever you might have set as the config default. You can do this by passing the mode (or second) parameter, which will relate to the name of a view file located in resources/vendor/frosty/

Aditional methods can be chained to add content and context, or to set the endpoint.

When using the tag, you'll specify if the endpoint is a url or a route, however when using the class directly, the endpoint is assumed to be a url string, if you wish to pass a route to it instead, then you are welcome to do that.

Unlike when using the Frosty tag, the Frosty class can directly accept parameters on the route below.

When you are ready to output the content, then you may call the render method.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of frosty with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
statamic/cms Version 3.1.*||3.2.*||3.3.*||3.4.*||4.*.*
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 handmadeweb/frosty contains the following files

Loading the files please wait ....