Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Conversation

@turrsis
Copy link
Contributor

@turrsis turrsis commented Feb 9, 2017

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\Assets helper can build link to module folder (through Router),
AssetsListener can detect this link (through Router too) and route it to module name and asset.
When AssetsListener detected asset link, it caching module asset to public folder and
browser can request this asset directly from public folder (it can be disabled).
Also AssetsListener can filter assets content, as sample .less to .css.

This is extention for zendframework/zend-view#106

@turrsis turrsis changed the title AssetsListener [WIP] AssetsListener Feb 9, 2017
* 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)
Copy link
Contributor

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;
Copy link
Contributor

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';
Copy link
Contributor

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';
Copy link
Contributor

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;
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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?

@Xerkus Xerkus added the wontfix label Feb 17, 2019
@Xerkus
Copy link
Member

Xerkus commented Feb 17, 2019

I am going to close this PR now due to lack of activity.
Additionally, this functionality is nice to have but I would argue it belongs to a module, not this package.

@Xerkus Xerkus closed this Feb 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants