Download the PHP package contenir/contenir-view-helper without Composer

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

contenir/contenir-view-helper

Continuous Integration codecov

laminas-view helpers shared by Contenir CMS sites: text formatting, links, media embeds, BEM form groups, and access to the application's ACL, settings and view cache from view scripts.

Requirements

The 1.x releases, which support PHP 8.0 to 8.2, remain available from the 1.x branch and v1.* tags; see UPGRADE-2.0.md.

Installation

With the Laminas component installer, the Contenir\View module (laminas-mvc) or Contenir\View\ConfigProvider (Mezzio) registers itself. Otherwise add Contenir\View to config/modules.config.php, or the ConfigProvider to your config aggregator.

Usage

Every helper is registered under its class name and a camelCase and PascalCase alias, so view scripts call $this->truncate(...) or $this->Truncate(...).

Helper Purpose Docs
dateFormat($date = null, $format = null) Format a date string (d M Y by default); null when unparseable Text
truncate($text, $length = 125, $strip = false, $etc = '...', $breakWords = false, $middle = false) Shorten text at a word boundary Text
fileSize($bytes, $decimals = 2, $system = FileSize::SYSTEM_METRIC) 1.5MB, or 1.5MiB in the binary system Text
fileType($mimeType) PDF or Document Text
richContent($html, $template = []) Lay out __SECTION__ / __COL__ markers as grid sections and columns Text
urlFormat($url = null, $format = null) Normalise a URL and render chosen parts Links
resourceLink($value = null, $defaultCta = null) Normalise a CMS link field into link objects Links
socialLink($network, $handleOrUrl, $options = []) Link to a social network profile Links
escapeEmail($email, $mailto = false) Obfuscate an email address against harvesters Links
image($path, $attributes = [], $pictureAttributes = []) Lazy-loaded <picture> served from a CDN Media
srcset($path, $sizes = []) srcset value for pre-resized derivatives Media
video($path, $options = [], $controls = false) Vimeo/YouTube embed or <video> element Media
icon($name, $options = []) Inline an SVG icon Media
formGroup($element, $displayAttributes = [], $groupAttributes = [...]) Render a laminas-form element as a BEM form group Forms
acl(), settings(), cache() The application's ACL, settings and view cache Application services

All helper classes are final. To customise one, register your own helper under the same alias; see Customising a helper.

Configuration

Key Used by Default
view_cdn.host, view_cdn.method image() no host; https
view_helper_config.icon.class icon() default wrapper class none (icon output bare)
settings settings() []
service ViewCache (a laminas-cache StorageInterface) cache() required to use cache()
service Application\Acl\Acl (an AclInterface) acl() required to use acl()

The laminas-mvc Module also sets shared view_manager defaults: an HTML5 doctype, error/404, error/403 and error/index templates, and the JSON view strategy. See Configuration.

Development

The QA toolchain is php-db/phpdb-qa-tools. Mago is a standalone binary, installed separately (brew install mago).

License

BSD-3-Clause. See LICENSE.md.


All versions of contenir-view-helper with dependencies

PHP Build Version
Package Version
Requires php Version ~8.3.0 || ~8.4.0 || ~8.5.0
laminas/laminas-cache Version ^3.12
laminas/laminas-cache-storage-adapter-filesystem Version ^2.4
laminas/laminas-config Version ^3.9
laminas/laminas-escaper Version ^2.13
laminas/laminas-form Version ^3.21
laminas/laminas-permissions-acl Version ^2.16
laminas/laminas-servicemanager Version ^3.22 || ^4.0
laminas/laminas-uri Version ^2.12
laminas/laminas-view Version ^2.35
psr/container Version ^1.1 || ^2.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-view-helper contains the following files

Loading the files please wait ...