geniv/nette-cookie-bar

Cookie bar component for Nette Framework

v2.1.1 2018-12-17 16:36 UTC

This package is auto-updated.

Last update: 2024-10-29 04:14:50 UTC


README

via:

Installation

$ composer require geniv/nette-cookie-bar

or

"geniv/nette-cookie-bar": "^2.0"

require:

"php": ">=7.0",
"nette/nette": ">=2.4",
"geniv/nette-general-form": ">=1.0"

Include in application

neon configure:

services:
    - CookieBar

usage:

protected function createComponentCookieBar(ICookieBar $cookieBar): ICookieBar
{
    //$cookieBar->setTemplatePath(__DIR__ . '/templates/cookieBar.latte');
    $cookieBar->setCookieName('nette-web-cookie-bar');
    //$cookieBar->setCookieExpire('+10 years');
    return clone $cookieBar;
}

usage (before </body>):

{control cookieBar}

resolve problem:

Nette\InvalidStateException: Component 'cookieBar' already has a parent. in ...

return clone $cookieBar;