setContent() public méthode

public setContent ( string $content )
$content string
Exemple #1
0
 /**
  * @param array $definition
  */
 protected function injectAsset($definition)
 {
     $assetInfo = new AssetInfo();
     if (isset($definition['path'])) {
         $assetInfo->setPath($definition['path']);
         $assetInfo->setOriginalPath($definition['path']);
     }
     if (isset($definition['content'])) {
         $assetInfo->setContent($definition['content']);
     }
     if (isset($definition['contentType'])) {
         $assetInfo->setContentType($definition['contentType']);
     }
     if (isset($definition['priority'])) {
         $assetInfo->setPriority($definition['priority'] + 0);
     }
     foreach ($this->handleAsset($assetInfo) as $asset) {
         if (isset($definition['position']) && 'bottom' === strtolower($definition['position'])) {
             //instead of position use $asset->getPosition();
             if (!$this->hasAsset($asset, $this->assetsInfoBottom)) {
                 $this->assetsInfoBottom[$asset->getPriority()][] = $asset;
             }
         } else {
             if (!$this->hasAsset($asset)) {
                 $this->assetsInfo[$asset->getPriority()][] = $asset;
             }
         }
     }
 }
Exemple #2
0
 /**
  * @return AssetInfo
  */
 public function getAssetInfo()
 {
     $assetInfo = new AssetInfo();
     $assetInfo->setPath($this->getSrc());
     $assetInfo->setPriority($this->getPriority());
     $assetInfo->setAllowCompression($this->getCompression());
     $assetInfo->setContentType($this->getType());
     $assetInfo->setContent($this->getContent());
     return $assetInfo;
 }