2017 © Pedro Peláez
 

library semantic

image

holantomas/semantic

  • Sunday, April 1, 2018
  • by holantomas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 6 % Grown

The README.md

holantomas/Semantic

Downloads this Month Latest Stable Version, (*1)

This extension is here to provide HTML Document api for Nette Framework., (*2)

Installation

Composer package is not prepared yet, (*3)

The best way to install is using Composer:, (*4)

$ composer require holantomas/semantic

Register extension in neon config, (*5)

extensions:
    semantic: holantomas\Semantic\Bridges\Nette\SemanticExtension

You can setup your own IDocument implementation., (*6)

semantic:
    document: namespace\to\your\document # Or false to disble it

If you have your implementation of IDocument you have to specify @required annotation for document properties which will cause warnings when are empty or NULL. You don't have to care about properties visibility, (*7)


use holantomas\Semantic\IDocument; class MyDocument implements IDocument { /** * @var string * @required - this make property required (throws warnings) */ private $title = ''; }

Enable Tracy panel(optional) - if is Tracy panel disabled, document throws E_USER_WARNING after render on @required properties which are NULL or empty, (*8)

tracy:
    bar:
        - holantomas\Semantic\Bridges\Tracy\SemanticPanel

For show properties in panel you have to specify @panel on every property., (*9)


use holantomas\Semantic\IDocument; class MyDocument implements IDocument { /** * @var string * @required - this make property required (throws warnings) * @panel - this make property show in tracy panel */ private $title = ''; }

annotations can be customized by Checker::$REQUIREMENT_ANNOTATION and SemanticPanel::$RENDER_ANNOTATION, (*10)

Usage

Document is automaticly registered as service and insert to presenter template param named as document. You don't have to do $this->template->document = $this->document; in presenter., (*11)

namespace App;

use Nette\Application\UI\Presenter;
use holantomas\Semantic\IDocument;

class BasePresenter extends Presenter
{
    /** @var IDocument @inject */
    public $document;

}

class ExamplePresenter extends BasePresenter
{
    public function actionDefault(){
        $this->document->setTitle('Hello world!');
    }

}
<html>
    <head>
        <title>{$document->getTitle()}</title>
        ...
    </head>
    ...
</html>

Of course you can autowire document to all services or components and modify properties., (*12)

Open graph and tests coming soon, (*13)

The Versions

01/04 2018

0.1

0.1.0.0

  Sources   Download

29/03 2017

dev-open-graph-refatored

dev-open-graph-refatored

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

05/02 2017

dev-open-graph

dev-open-graph

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

01/02 2017

dev-master

9999999-dev

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

01/02 2017

dev-requirement-checker

dev-requirement-checker

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

01/02 2017

0.4

0.4.0.0

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

30/01 2017

0.3

0.3.0.0

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

29/01 2017

0.2

0.2.0.0

Tool for create semantic websites

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0