-
-
Notifications
You must be signed in to change notification settings - Fork 42
Assets loading with themes and skins supported #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yahasana
wants to merge
15
commits into
ice:dev
Choose a base branch
from
Yahasana:patch-23
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
1) if `uri` is start with `/`, it'll try to load asset from document root ```php // Register specific services for the module public function registerServices(Di $di) { $di->assets->setOptions([ 'source' => __DIR__ . '/Skin/Default/', 'target' => 'min/', 'minify' => 3 ]); } // load from module dir/Skin/Default/css/style.css $this->assets->addCss(['css/style.css']); // load from document_root/Skin/Default/css/style.css $this->assets->addCss(['/Skin/Default/css/style.css']); ``` 2) always store the min files in the document_root/target dir
place min file to document root
@mruz please review the new features i just add to comment. i'll trying to implement it soon if you agree with that. and after that i think Ice is ready for new release and good for deploying to production |
mruz
reviewed
Oct 4, 2018
get/set cache the prepared resources
@mruz review plz |
`type` parameter change from `text/css` or `text/javascript` to `css` or `js` ```php $assets->addCss(['css/style.css', 'type' => 'css']) ->addCss(['js/script.js', 'type' => 'js']) ``` but not ```php $assets->addCss(['css/style.css', 'type' => 'text/css']) ->addCss(['js/script.js', 'type' => 'text/javascript'])
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assets loading with themes and skins supported. assume that different apps (or plugins) are independent with each others but share the same basic modules and public resources
A) asset cases: there are stylesheet files in public
css
share by all appsand app specific stylesheet locate in its directory. e.g.
B) loading source and target
minify
public/css/style.css
topublic/min/css/style.min.css
minify
account/default/css/account.css
topublic/min/css/account.min.css
public/default/css/account.css
not exists,copy
account/default/css/account.css
topublic/default/css/
account/default/css/account.css
topublic/default/css/
C) implement
uri
is start with/
, it'll try to load asset from document rootONE MORE THING
type
parameter change fromtext/css
ortext/javascript
tocss
orjs
but not