Comments (17)
What sort of path do you mean exactly? Resolving or caching?
from assetmanager.
resolving
from assetmanager.
Resolving would happen on the cdn itself. I'm confused as to what you're trying to do.If you wish to resolve a file to an url you'll have to always connect to the database or load in array. I'd put the assetmanager on the cdn, to improve lookup speed.
from assetmanager.
I'm sorry, i don't understand english very well.
I used to use zf2-assetic-module and i could set these values:
'webPath' => 'path/to/my/cdn/docroot,
'baseUrl' => 'http://mycdnserverHost.com,
So i'm not sure that AssetManager is working the same .
from assetmanager.
That's very unfortunate. English is the main language in the development community, you should work on that :) Anyway, you're talking about fetching assets from a different server. Currently there is no such resolver yet. The assets should exist on the same server, and if not you'll need a custom resolver. So the way I see it, you have three options.
- Write a custom resolver
- Write a new resolver and submit a PR
- Wait for me to implement this feature
I'm sorry about the missing feature.
from assetmanager.
I think the third option is great ;-)
from assetmanager.
Alright then. That might take a while, though. I have no idea how I'm going to set this up as I don't know what it involves. Perhaps you can already mimic this by setting the basepath to the cdn? Could you test this?
from assetmanager.
'css/plugins.css' => array(
$asset_serveur['docroot'].'/common/jQuery/plugins/pretty/css/prettyPhoto.css',
)
When calling http://mywebsite/css/plugins.css =>
Fatal error: Uncaught exception 'AssetManager\Exception\RuntimeException' with message 'Asset 'N:/DEV/zend/mya7/static/common/jQuery/plugins/pretty/css/prettyPhoto.css' could not be found.' in N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Resolver\CollectionResolver.php:132
Stack trace:
#0 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Resolver\AggregateResolver.php(46): AssetManager\Resolver\CollectionResolver->resolve('css/plugins.css')
#1 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Service\AssetManager.php(174): AssetManager\Resolver\AggregateResolver->resolve('css/plugins.css')
#2 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Service\AssetManager.php(85): AssetManager\Service\AssetManager->resolve(Object(Zend\Http\PhpEnvironment\Request))
#3 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Module.php(61): AssetManager\Service\AssetManager->resolvesToAsset(Object(Zend\Http\PhpEnvironment\Request))
#4 [internal function]: AssetManager\Module->onDispatch in N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Resolver\CollectionResolver.php on line 132
However file N:/DEV/zend/mya7/static/common/jQuery/plugins/pretty/css/prettyPhoto.css exists!
from assetmanager.
Where did you put that configuration value? That won't work unless there's a collection involved, and it's defined in paths. Read the wiki please :)
from assetmanager.
Yes, file is found by adding :
'paths' => array(
$asset_serveur['docroot'],
),
Thank you!
Now sometimes i got filter errors:
'filters' => array(
'css/plugins.css' => array(
'filter' => 'CssMinFilter', # return Fatal error: Uncaught exception 'AssetManager\Exception\RuntimeException' with message 'No filter found for C'
),
'css/plugins.css' => array(
'filter' => 'Lessphp', # return Fatal error: Uncaught exception 'AssetManager\Exception\RuntimeException' with message 'No filter found for L'
),
from assetmanager.
Again, read the wiki please :)
<?php
return array(
'asset_manager' => array(
'filters' => array(
'js/myAsset.js' => array(
array(
'filter' => 'Lessphp',
),
),
),
),
);
note: I advice against using lessphp. Try using the Less filter in stead, it has less bugs.
from assetmanager.
So Resolvers page is not up to date ;-)
https://github.com/RWOverdijk/AssetManager/wiki/Resolvers
See:
array( 'css/everything-less.css' => array( 'filter' => 'Lessphp', ), 'css/everything.css' => array( 'filter' => 'UglifyCss', ), ), ?>from assetmanager.
You're right, I've made a mistake there. The rest is correct. Nice catch :) Just look at the filter page for filter info, I will update the resolver wiki.
from assetmanager.
Updated.
from assetmanager.
Thank you very much @RWOverdijk
It works !
Now i need to find out a place to put CssMin and JsMin classes.
Fatal error: Class 'CssMin' not found in vendor\kriswallsmith\assetic\src\Assetic\Filter\CssMinFilter.php on line 72
from assetmanager.
That's up to you. I'd advice you to add them in a "deps" dir, or to create a module with the specific task of updating and including those dependencies.
from assetmanager.
Thank you very much for your advices @RWOverdijk !
from assetmanager.
Related Issues (20)
- Support for EventManager & ServiceManager 3.0 HOT 6
- Append last modified date to Asset View Helper even withoud cache HOT 5
- FilePathCache throws exceptions almost every release HOT 13
- AssetManager is not installable with new skeleton application HOT 8
- PHP Fatal error: Uncaught TypeError: Argument 2 passed to AssetManager\Service\AssetCacheManager::setCache() must implement interface Assetic\Asset\AssetInterface, null given HOT 8
- Bower components and image paths HOT 2
- Wrong MIME type when converting asset HOT 2
- Asset not loaded on latest ZendSkeletonFramework HOT 2
- How to create a resolver that remap extension? HOT 4
- Create Seperate "Core" repository and package HOT 8
- Caching/Processing assets without asset() view helper HOT 3
- node: Permission denied HOT 1
- How to add a response header - Last-Modified, E-Tag HOT 1
- unable to load AssetManager HOT 1
- Asset view helper not work with ZF3 with basic documentation configuration. ZF3 use his own Asset view helper. HOT 1
- asset view helper BC HOT 10
- Can't install via composer due to version locks HOT 18
- Composer Version 2x HOT 1
- packagist versions not auto updated HOT 3
- laminas/laminas-dependency-plugin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assetmanager.