PHP code example of enjoyscms / articles

1. Go to this page and download the library: Download enjoyscms/articles 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/ */

    

enjoyscms / articles example snippets


use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\EventManager;
use Gedmo\Timestampable\TimestampableListener;
use Gedmo\Tree\TreeListener;

$evm = new EventManager();
$annotationReader = new AnnotationReader();

$timestampListener = new TimestampableListener();
$timestampListener->setAnnotationReader($annotationReader);
$evm->addEventSubscriber($timestampListener);

$treeListener = new TreeListener();
$treeListener->setAnnotationReader($annotationReader);
$evm->addEventSubscriber($treeListener);

use Doctrine\Common\Annotations\AnnotationRegistry;
use Gedmo\Mapping\Annotation\Timestampable;
use Gedmo\Mapping\Annotation\Tree;
use Gedmo\Mapping\Annotation\TreeClosure;
use Gedmo\Mapping\Annotation\TreeLevel;
use Gedmo\Mapping\Annotation\TreeParent;

AnnotationRegistry::loadAnnotationClass(TreeLevel::class);
AnnotationRegistry::loadAnnotationClass(Tree::class);
AnnotationRegistry::loadAnnotationClass(TreeClosure::class);
AnnotationRegistry::loadAnnotationClass(TreeParent::class);
AnnotationRegistry::loadAnnotationClass(Timestampable::class);