Skip to content

Bagaimana Cara merubah Inline string js/json/style jadi punya url/ internal url? #266

Discussion options

You must be logged in to vote
Hook::set('route', function ($content, $path) {
    if ('/index.js' === $path) {
        status(200);
        type('text/javascript');
        return content(LOT . D . 'y' . D . 'template' . D . 'index.js');
    }
    return $content;
}, 0);

Asset::set($url . '/index.js', 20);
Hook::set('content', function ($content) {
    return preg_replace('/\/index\.js\?v=\d+/', '/index.js');
});

Replies: 4 comments 17 replies

Comment options

You must be logged in to vote
4 replies
@taufik-nurrohman
Comment options

Answer selected by yuliakbard
@yuliakbard
Comment options

@yuliakbard
Comment options

@taufik-nurrohman
Comment options

Comment options

You must be logged in to vote
1 reply
@yuliakbard
Comment options

Comment options

You must be logged in to vote
9 replies
@taufik-nurrohman
Comment options

@yuliakbard
Comment options

@taufik-nurrohman
Comment options

@yuliakbard
Comment options

@yuliakbard
Comment options

Comment options

You must be logged in to vote
3 replies
@taufik-nurrohman
Comment options

@bungfrangki
Comment options

@yuliakbard
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
x.route Route extension.
3 participants