PHP code example of stormdelta / latex-encoder-annotation-bundle

1. Go to this page and download the library: Download stormdelta/latex-encoder-annotation-bundle 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/ */

    

stormdelta / latex-encoder-annotation-bundle example snippets


//app/AppKernel.php

use ...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new StormDelta\LatexEncoder\AnnotationBundle\StormDeltaLatexEncoderAnnotationBundle(),
            ...
        );
        ...
}

//src/AppBundle/Entity/LatexEntity.php

namespace AppBundle\Entity\LatexEntity;

use StormDelta\LatexEncoder\AnnotationBundle\Annotation\LatexEncoderAnnotation as LatexEncode;

class LatexEntity
{
    /**
     * @LatexEncode
     */
    $variable;
}

//src/AppBundle/Controller/DefaultController.php

namespace AppBundle\Controller;

use ...

class DefaultController extends Controller
{
    ...
    public function indexAction(...)
    {
        $entity = new LatexEntity();
        ...
        $entity = $this->get('stormdelta.latexencoder.driver')->encode($entity);
        ...
        return array('entity' => $entity);
    }
}