Download the PHP package helsingborg-stad/component-library without Composer

On this page you can find all versions of the php package helsingborg-stad/component-library. 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 component-library

Component Library

A library of blade components compatible with WordPress.

Known issues

Have any issues? This list is your first resort.

Example usage

A registered component can be utilized as a component or directive just as in laravel. They do however have the added functionality to load the controller before render to enshure that stuff is formatted and defined.

Render a component

Data flow

Base controller components This controller handles all data flow to every component. There are multiple ways of inputting data to a component.

  1. The default configuration of the component. These settings are made in the configuration json in each component folder. All variables used in the controller SHOULD be declared here. This is to avoid undeclared variabe varnings.

  2. By populating the directive (in view file). This should be data that idicates states like isDisabled => true etc. This is the main location of end user customization.

  3. By data manipulation in the controller connected to each component. This data can be in every form, but should focus on translating other input to view data. This file can contain clear-text-classes.

Example:

Filters

When component library is used in WordPress. Filters are enabled to allow for filtering from WordPress. There are multiple filters for each component.

Filter (General): BladeComponentLibrary/Component/Data - Takes $data

Filter (Component specific): ComponentLibrary/Component/ComponentName/Data - Takes $data

Filter class (General): ComponentLibrary/Component/Class - Takes $class

Filter class (Component specific): ComponentLibrary/Component/ComponentName/Class - Takes $class

Each data attribute also has a corresponding filter eg. ComponentLibrary/Component/ComponentName/dataVar

Additional paths (WordPress Specific)

You may ask the component library to render more view paths by using the ComponentLibrary/ViewPaths filter. Simply add another path to the component library by doing the following:

Iframe

ComponentLibrary/Component/Iframe/GetSuppliers

Alter the list of pre-defined suppliers (sources) for iframes

Icon

ComponentLibrary/Component/Icon/AltTextPrefix

Alter the prefix used when describing icons.

ComponentLibrary/Component/Icon/AltText

Alter the array used when describing icons.

ComponentLibrary/Component/Icon/AltTextUndefined

Alter the undefined message used when describing icons.

Add a builtin component

The most efficient and proposed way of adding a compning is by a PR to this package. It will then be available for everyone to be used. A internal component requires three different files.

The view

The view sould be as simple as possible, in most cases just a few if-statements. For more advanced solution, please consider to use components as childs to a larger component according to Atomic design principle.

Example:

The controller

The controller should handle all logic associated with a component. This file soule purpose is to remove any logic from the view.

Example:

The configuration

A simple configuration of the slug for the component (used as component name). The default parameters and the view name (defaults to the slug name). The configuration should be written in a valid json format. This file must contain the keys "slug", "default" (default parameters), description and "view".

Example:


All versions of component-library with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
helsingborg-stad/blade Version ^3.5.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 helsingborg-stad/component-library contains the following files

Loading the files please wait ....