-
Notifications
You must be signed in to change notification settings - Fork 2
Installation
Symftony edited this page Dec 10, 2017
·
1 revision
The recommended way to install Xpression is through Composer.
# Install Composer
curl -sS https://getcomposer.org/installer | php
php composer require symftony/xpression
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
php composer require symftony/xpression-bundle
After you have installed the package, you just need to add the bundle to your AppKernel.php file:
// in AppKernel::registerBundles()
$bundles = array(
// ...
new Symftony\XpressionBundle\XpressionBundle()
// ...
);
The bundle provide a controller annotation
@Xpression(
expressionBuilder="odm" //chose the expression builder orm/odm/common/closure
source="query" //OPTIONNAL choose request parameter bag
sourceName="query" //OPTIONNAL choose request parameter name
targetName="query" //OPTIONNAL choose controller target name
allowedTokenType=Lexer::ALL //OPTIONNAL choose token type allowed
)
/**
* @Xpression(expressionBuilder="odm")
*/
public function myAction($query)
{
//use $query here
//...
}