Download the PHP package contenir/contenir-contact without Composer

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

contenir/contenir-contact

Continuous Integration codecov

Framework-free contact details for Contenir sites: the business and its offices, read from the site's settings, for page templates, Contact blocks and search engines alike.

The settings are edited in Site Settings > Office details. Mezzio sites read them through contenir/contenir-contact-mezzio, which gives templates a contact() helper.

Install

Reading the settings

The settings are a site's nested settings array. Setting names are singular, even for lists:

Overrides

An office has the business's value for each of these unless its row has the key: trading_name, legal_name, tax_id, type, additional_type, telephone, email, hour, timezone, price_range, cuisine, menu, reservation and star_rating. A key with a value is the office's own; a key that is empty (null, '' or []) means the office has none, whatever the business has. $office->overridden and $office->cleared name them.

Rows saved by the CMS's Office details come as ['fields' => [...]] with every input posted, so there an empty value inherits the business's (the CMS has no way yet to say "none"), and flat latitude and longitude become geolocation. Rows written by hand keep the rules above.

The first office marked primary is the primary office, or the first office when none is. The primary office is always shown to search engines. Rows without a name, and a second row with an id already seen, are left out.

Opening hours

Each entry has its days, as schema.org's codes (Mo to Su), and an opening and closing time. Times are local to the office's timezone, so isOpenAt() is right for a Perth office whoever reads it. A closing time before the opening time runs past midnight; one the same as the opening time is open round the clock; 24:00 closes at midnight. No entries is "by appointment" or "closed"; the site words it.

Business types

BusinessType is a schema.org organisation type from the bundled vocabulary (schema.org 30.1). It knows its ancestors (isA('FoodEstablishment'), isLocalBusiness()) and which properties it takes (takes('servesCuisine')), so a law firm is never asked for its cuisine, and a plain Organization never gets opening hours. BusinessTypes::groups() is the grouped list Office details offers; BusinessType::exists() checks a type entered under Other.

AdditionalTypes lists kinds of business schema.org has no type for, each matched to its Wikidata entry (Architecture firm, Interior design firm, Photography studio…), with search() for the picker.

TypeDetail holds the values only some types take: price range, cuisine, menu, reservations and star rating.

To update the vocabulary to a new schema.org release, download its JSON-LD file and run:

Contact blocks

A Contact block saves which offices it shows and how. Offices::pick() turns its choice into offices (all, the primary, or the chosen ones in the editor's order), skipping any removed since; OfficeChoice::missing() names those for the CMS to mark.

Formats

A format is a set of parts shown together: name, trading_name, legal_name, tax_id, address, telephone, email, hour and map. The package has three (full, address and compact); a site adds its own, or replaces these by name, in its config:

HtmlRenderer draws an <address> with a BEM class per part (contact__address, contact__telephone…), the telephone and email as links, every value escaped; a part without a value is left out. For the business, the address and map are its primary office's. A site's own template for a format is drawn by its framework adapter.

Development

Licence

BSD-3-Clause. See LICENSE.md.


All versions of contenir-contact with dependencies

PHP Build Version
Package Version
Requires php Version ~8.3.0 || ~8.4.0 || ~8.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 contenir/contenir-contact contains the following files

Loading the files please wait ...