stormdelta/latex-encoder-annotation-bundle
最新稳定版本:v0.1.7
Composer 安装命令:
composer require stormdelta/latex-encoder-annotation-bundle
包简介
Latex Encoder Annotation Bundle
README 文档
README
This bundle is still under development!
Use annotations to safely encode values to LaTeX. Installation
composer require stormdelta/latex-encoder-annotation-bundle
Configuration
Configure Bundle in app/AppKernel.php
//app/AppKernel.php
use ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
...
new StormDelta\LatexEncoder\AnnotationBundle\StormDeltaLatexEncoderAnnotationBundle(),
...
);
...
}
Usage
Use annotations in the entity
//src/AppBundle/Entity/LatexEntity.php
namespace AppBundle\Entity\LatexEntity;
use StormDelta\LatexEncoder\AnnotationBundle\Annotation\LatexEncoderAnnotation as LatexEncode;
class LatexEntity
{
/**
* @LatexEncode
*/
$variable;
}
Encode in the controller
//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);
}
}
"Advanced" Usage
Use LatexEncoderFollowAnnotation in the entity to encode related entities
//src/AppBundle/Entity/LatexEntity.php
namespace AppBundle\Entity\LatexEntity;
...
use StormDelta\LatexEncoder\AnnotationBundle\Annotation\LatexEncoderFollowAnnotation as LatexFollow;
class LatexEntity
{
/**
* @ORM\OneToMany(targetEntity="...")
* @LatexFollow
*/
$variables;
}
统计信息
- 总下载量: 36
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-29