本文整理匯總了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');
}