PHP code example of chamber-orchestra / meta
1. Go to this page and download the library: Download chamber-orchestra/meta 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/ */
chamber-orchestra / meta example snippets
use ChamberOrchestra\FileBundle\Mapping\Annotation as Upload;
use ChamberOrchestra\Meta\Entity\MetaTrait;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[Upload\Uploadable(prefix: 'article')]
class Article
{
use MetaTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
// your entity fields...
}
use ChamberOrchestra\Meta\Entity\Helper\RobotsBehaviour;
$entity->getRobotsBehaviour(); // RobotsBehaviour::IndexNoFollow
$entity->getFormattedRobotsBehaviour(); // "index, nofollow"
RobotsBehaviour::NoIndexNoFollow->format(); // "noindex, nofollow"