-
Notifications
You must be signed in to change notification settings - Fork 89
[WIP] AssetsListener #216
[WIP] AssetsListener #216
Conversation
| * Zend Framework (http://framework.zend.com/) | ||
| * | ||
| * @link http://github.com/zendframework/zf2 for the canonical source repository | ||
| * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2017 now
| */ | ||
| protected $filterManager; | ||
|
|
||
| protected $request; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @var doc
|
|
||
| protected $request; | ||
|
|
||
| protected $routeName = 'assets'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @var doc
|
|
||
| protected $routeName = 'assets'; | ||
|
|
||
| protected $routerCacheFolder = 'assets'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @var doc
|
|
||
| protected $routerCacheFolder = 'assets'; | ||
|
|
||
| protected $useInternalRouter = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @var doc
| return $response; | ||
| } | ||
|
|
||
| protected function filter(MvcEvent $event, $assetFile, $assetItem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private? docs?
| return $assetContent; | ||
| } | ||
|
|
||
| protected function cache(MvcEvent $event, $source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private, phpdocs?
| * @param array|RouteStackInterface $router | ||
| * @return self | ||
| */ | ||
| public function setRouter($router) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases would an array be a suitable router? Shouldn't just requiring an interface be a requirement?
| */ | ||
| public function getAssetsResolver() | ||
| { | ||
| return $this->assetsResolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if $this->assetsResolver is not set?
| */ | ||
| public function getFilterManager() | ||
| { | ||
| return $this->filterManager; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if $this->filterManager is not set?
|
I am going to close this PR now due to lack of activity. |
Allow to use assets (css, js etc.) from modules, or other not public folders
Web server has not access to module folder directly, but this is possible through
AssetsListener.Zend\View\Helper\Assetshelper can build link to module folder (through Router),AssetsListenercan detect this link (through Router too) and route it to module name and asset.When
AssetsListenerdetected asset link, it caching module asset to public folder andbrowser can request this asset directly from public folder (it can be disabled).
Also
AssetsListenercan filter assets content, as sample .less to .css.This is extention for zendframework/zend-view#106