-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Setting absolute Path in Phalcon\Assets\Resource::setTargetUri() #1157
Comments
When adding the resource to the collection you need to set it as non-local: $this->assets->addJs('http://static.otherserver.com/js/final.js', false); |
@phalcon see disc on forum <?php
$this->assets
->collection('application')
->addJs('src/app/models/Cart.js')
->addJs('src/app/models/Metric.js')
->addJs('src/app/models/Product.js')
->addJs('src/app/models/Shop.js')
->addJs('src/app/models/User.js')
->addJs('src/app/views/product/index/view/Shop.js')
->addJs('src/app/views/product/index/view/CollectionModal.js')
->addJs('src/app/views/components/CommentsAlert.js')
->addJs('src/app/views/components/Modal.js')
->addJs('src/app/views/blocks/Collection.js')
->addJs('src/app/views/blocks/Comments.js')
->addJs('src/app/views/blocks/FollowButton.js')
->addJs('src/app/views/blocks/User.js')
->addJs('src/app/views/blocks/Product.js')
->addJs('src/app/views/user/feed/Collections.js')
->addJs('src/app/views/user/feed/Events.js')
->addJs('src/app/views/user/feed/Followers.js')
->addJs('src/app/views/user/Feed.js')
->addJs('src/app/views/Layout.js')
->addJs('src/app.js')
->addJs('js/animate.js')
->join(true)
->addFilter(new Phalcon\Assets\Filters\Jsmin())
->setTargetPath(APPLICATION_PATH . '/../public/js/application.js')
->setTargetUri('http://static.site.domain/js/application.js');
?> |
But, setTargetUri is intended to pass an URI (Uniform Resource Identifier) as parameter not a URL (Uniform Resource Locator) as parameter |
@phalcon okey. buy how can i set url? this class havn`t method setTargetUrl() |
@phalcon |
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues |
As mentioned here before:
There's no possibility to set a absolute uri ( Phalcon\Assets\Resource::setTargetUri() ), when using the compressor filters and a different static server.
Set:
Result:
It is more obviously when you set up an absolute baseUri in bootstrap.
Then you'll get SLT:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: