forked from photo/frontend
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pipeline' into development
- Loading branch information
Showing
9 changed files
with
2,294 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Tag controller for API endpoints | ||
* | ||
* This controller does much of the dispatching to the Tag controller for all tag requests. | ||
* @author Jaisen Mathai <jaisen@jmathai.com> | ||
*/ | ||
class AssetsController extends BaseController | ||
{ | ||
public static function get($type, $compression, $files) | ||
{ | ||
$files = (array)explode(',', $files); | ||
$pipeline = getAssetPipeline(); | ||
foreach($files as $file) | ||
{ | ||
if($type === 'css') | ||
$pipeline->addCss($file); | ||
elseif($type === 'js') | ||
$pipeline->addJs($file); | ||
} | ||
|
||
if($type === 'css') | ||
header('Content-type: text/css'); | ||
elseif($type === 'js') | ||
header('Content-type: text/javascript'); | ||
|
||
if($compression === 'm') | ||
echo $pipeline->getMinified('css'); | ||
elseif($compression === 'c') | ||
echo $pipeline->getCombined('css'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.