Skip to content
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

Make ComKoowaTemplateHelperBehavior::isLoaded() smart #89

Open
johanjanssens opened this issue May 16, 2017 · 1 comment
Open

Make ComKoowaTemplateHelperBehavior::isLoaded() smart #89

johanjanssens opened this issue May 16, 2017 · 1 comment
Labels
Milestone

Comments

@johanjanssens
Copy link
Member

Reduce duplicate code. Add a loadScripts() method to KTemplateHelperBehavior that receives a string and handles the checks to see if the scripts have already been loaded or not. Method will return a string, or not.

@johanjanssens
Copy link
Member Author

Suggestion:

static::loadOnce(callable $callback)

static::loadOnce(function() { return '<ktml:script>'; });

Then loadOnce can keep track of passed callables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant