本文整理汇总了PHP中Assetic\Asset\AssetCollection::getContent方法的典型用法代码示例。如果您正苦于以下问题:PHP AssetCollection::getContent方法的具体用法?PHP AssetCollection::getContent怎么用?PHP AssetCollection::getContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assetic\Asset\AssetCollection
的用法示例。
在下文中一共展示了AssetCollection::getContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
/**
* This method is used instead of APY\JsFormValidationBundle\Generator\FormValidationScriptGenerator::generate
* to return inline client-side form validation javascript
*
* @param FormView $formView
* @param boolean $overwrite
*
* @return string
*/
public function generate(FormView $formView, $overwrite = true)
{
$validationBundle = $this->getValidationBundle();
$javascriptFramework = strtolower($this->container->getParameter('apy_js_form_validation.javascript_framework'));
$template = $this->container->get('templating')->render("{$validationBundle}:Frameworks:JsFormValidation.js.{$javascriptFramework}.twig", $this->generateValidationParameters($formView));
// Js compression
if ($this->container->getParameter('apy_js_form_validation.yui_js')) {
// Create asset and compress it
$asset = new AssetCollection();
$asset->setContent($template);
return $asset->getContent();
}
return $template;
}
示例2: testSetContent
public function testSetContent()
{
$coll = new AssetCollection();
$coll->setContent('asdf');
$this->assertEquals('asdf', $coll->getContent(), '->setContent() sets the content');
}