示例#1
0
 /**
  * Compile asset block
  *
  * @param   bool  $process
  * @return  string
  */
 public function compile($process = FALSE)
 {
     // Set content
     $content = $this->content();
     if ($process and $this->processor()) {
         // Process content
         $content = Asset_Processor::process($this->processor(), $this->content());
     }
     return $content;
 }
示例#2
0
 /**
  * Compile files
  *
  * @param  bool $process
  *
  * @return string
  */
 public function compile($process = FALSE)
 {
     // Get file contents
     $content = file_get_contents($this->source_file());
     foreach ($this->engines() as $engine) {
         // Process content with each engine
         $content = Asset_Engine::process($engine, $content, $this);
     }
     if ($process and $this->processor()) {
         // Process content with processor
         $content = Asset_Processor::process($this->processor(), $content);
     }
     return $content;
 }