Download the PHP package danlapteacru/facetwp-builder without Composer

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

FacetWP Builder

Create, register, and reuse FacetWP plugin facets/templates using PHP, and keep them in your source code repository. To read more about registering FacetWP facets and templates via PHP, go here: facets documentation and templates documentation.

Packagist Version PHP from Packagist Packagist Downloads GitHub License

Minimum Requirements

Installation

If your project isn't using composer, you can require the autoload.php file.

Adding/Removing FacetWP Facets and Templates with the Builder

Table of Contents

Facets Templates
Autocomplete Add a template
Checkbox
Date Range
Dropdown
fSelect
Hierarchy
Number Range
Pager
Proximity
Radio
Reset
Search
Slider
Sort
Star Rating
User Selections

Facet Types

You can find a full reference of available facets on the official FacetWP documentation.

Autocomplete

Official Documentation

Checkboxes

Official Documentation

Date Range

Official Documentation

Dropdown

Official Documentation

fSelect

Official Documentation

Hierarchy

Official Documentation

Number Range

Official Documentation

Pager

Official Documentation

Proximity

Official Documentation

Radio

Official Documentation

Reset

Official Documentation

Search

Official Documentation

Slider

Official Documentation

Sort

Official Documentation

Star Rating

Official Documentation

User Selections

Official Documentation

Facet shortcut methods

Instead of passing all options as an array to the add method, you can chain setter methods on the returned FacetBuilder. All setters transform values automatically (booleans become 'yes'/'no' strings).

For custom/arbitrary attributes not in the list above, use setAttr(string $name, mixed $value) directly.

Managing facets

FacetsBuilder exposes the following methods for working with its facet collection:

Building and registering

Calling build() on the FacetsBuilder compiles the config and — by default — registers facets with FacetWP via the facetwp_facets WordPress filter.

Note: calling build() on the FacetBuilder returned by addSearch() / addCheckbox() / etc. builds only that single facet's config array and does not register anything with WordPress. Always call $builder->build() on the FacetsBuilder instance to register.

Templates

You can find a full reference of how to add a template with PHP on the official FacetWP documentation.

Add a template

Use addTemplate(string $name, array $args = []) to add a template. It returns a TemplateBuilder for further configuration.

Example using the array form:

Attention! The query key must contain a PHP code string. Use the setQuery() helper instead to pass a plain array and have it converted automatically.

Template shortcut methods

Example using chainable setters:

setPostType() and setPostsPerPage() are convenience helpers that update both query and query_obj in one call:

Default label

If setLabel() is not called and no label key is passed to addTemplate(), the label is auto-generated from the template name.

Default modes

If setModes() is not called and no modes key is passed, the following defaults are used:

Managing templates

TemplatesBuilder exposes the following methods for working with its template collection:

Building and registering templates

Composing Custom/3rd Party Addon Facets

Use addFacet(string $name, string $type, array $args = []) to add a facet with an arbitrary type string.

To use a type not in the built-in ALLOWED_FACET_TYPES constant, register it via the danlapteacru/facetwp-builder/allowed_facet_types filter hook.

Hooks

danlapteacru/facetwp-builder/allowed_facet_types

Filter the list of allowed facet types. Use this to add support for custom or 3rd-party addon types.

danlapteacru/facetwp-builder/facets

Filter the compiled facets array before it is returned by FacetsBuilder::build().

danlapteacru/facetwp-builder/facet_key

Filter the resolved facet type key before it is validated inside FacetsBuilder::__call(). Useful for aliasing method names to custom type strings.

danlapteacru/facetwp-builder/templates

Filter the compiled templates array before it is returned by TemplatesBuilder::build().

Examples

Table of Contents

Examples
Add Facets
Add a custom facet
Add Template

Add Facets

Add a custom facet

Add Template

Credits

FacetWP Builder is created and maintained by Dan Lapteacru.

Full list of contributors can be found here.

License

FacetWP Builder is released under the MIT License.


All versions of facetwp-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
itinerisltd/itineris-wp-coding-standards Version ^1.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 danlapteacru/facetwp-builder contains the following files

Loading the files please wait ...