PHP code example of geniv / nette-favorite

1. Go to this page and download the library: Download geniv/nette-favorite library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geniv / nette-favorite example snippets


protected function createComponentFavorite(Favorite $favorite): Favorite 
{
    //$otherComponent->addComponent($favorite, 'favorite');
    
    // $favorite->setTemplatePath(__DIR__ . '/templates/favorite.latte');
    $favorite->setSource($this->favoriteSource);
    $favorite->onSetFavorite[] = function (int $id) {
        $this->setFavorite($id);
    };
}

$favorite->isFavorite($id);
json
"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0"