2017 © Pedro PelĂĄez
 

library meta-control

Nette control for managing meta data in HTML header.

image

nepada/meta-control

Nette control for managing meta data in HTML header.

  • Wednesday, June 27, 2018
  • by xificurk
  • Repository
  • 1 Watchers
  • 1 Stars
  • 284 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 40 % Grown

The README.md

Meta Control

Build Status Coverage Status Downloads this Month Latest stable, (*1)

Installation

Via Composer:, (*2)

$ composer require nepada/meta-control

Usage

First register the control factory in your config and optionally set up default metadata:, (*3)

services:
    -
        implement: Nepada\MetaControl\MetaControlFactory
        setup:
            - setCharset('utf-8')
            - setAuthor('Jon Doe')

Use the control factory in your presenter:, (*4)

protected function createComponentMeta(): Nepada\MetaControl\MetaControl
{
    $control = $this->metaControlFactory->create();
    $control->setDescription('Lorem ipsum');
    return $control;
}

And render it in your Latte template:, (*5)

<html>
<head>
    {control meta}
</head>
<body>
    ...
</body>
</html>

Overview of supported meta tags

Charset:, (*6)

// <meta charset="utf-8">
$control->setCharset('utf-8');
$control->getCharset(); // 'utf-8'

Document metadata:, (*7)

// <meta name="author" content="John Doe">
$control->setMetadata('author', 'Jon Doe');
$control->getMetadata('author'); // 'Jon Doe'

Document properties:, (*8)

// <meta property="og:title" content="Foo title">
$control->setProperty('og:title', 'Foo title');
$control->getProperty('og:title'); // 'Foo title'

Pragma directives:, (*9)

// <meta http-equiv="content-type" content="text/html; charset=UTF-8">
$control->setPragma('content-type', 'text/html; charset=UTF-8');
$control->getPragma('content-type'); // 'text/html; charset=UTF-8'

Shorthands for standard metadata

Author:, (*10)

// <meta name="author" content="John Doe">
$control->setAuthor('Jon Doe');
$control->getAuthor(); // 'Jon Doe'

Description:, (*11)

// <meta name="description" content="Lorem ipsum">
$control->setDescription('Lorem ipsum');
$control->getDescription(); // 'Lorem ipsum'

Keywords:, (*12)

// <meta name="keywords" content="foo, bar, baz">
$control->setKeywords('foo', 'bar');
$control->addKeyword('baz');
$control->getKeywords(); // ['foo', 'bar', 'baz']

Robots:, (*13)

// <meta name="robots" content="noindex, nofollow">
$control->setRobots('noindex, nofollow');
$control->getRobots(); // 'noindex, nofollow'

The Versions

27/06 2018

dev-master

9999999-dev

Nette control for managing meta data in HTML header.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Petr MorĂĄvek

component nette meta header

02/06 2018

v1.0.1

1.0.1.0

Nette control for managing meta data in HTML header.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Petr MorĂĄvek

component nette meta header

17/09 2017

v1.0.0

1.0.0.0

Nette control for managing meta data in HTML header.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Petr MorĂĄvek

component nette meta header