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

Filter url_encode was extended for objects #588

Merged
merged 1 commit into from
Nov 13, 2018

Conversation

ahtohbi4
Copy link
Contributor

@ahtohbi4 ahtohbi4 commented Sep 7, 2018

The ability to encode an object to URL by the filter url_encode was added according to the Twig PHP.

const data = {
    foo: {
        baz: 'bar',
    },
};
const template = twig({ data: '{{ foo|url_encode }}' });

console.log(template.render(data)); // => "foo%5Bbaz%5D=bar"

@ahtohbi4
Copy link
Contributor Author

What about this PR? Are there some doubts?

@RobLoach
Copy link
Collaborator

Thanks a lot. Looks pretty good, is there anything missing before we merge it?

@ahtohbi4
Copy link
Contributor Author

At first, were written tests according to Twig PHP documentation, after that was written the code... I hope I missed nothing. 🙄

@RobLoach RobLoach merged commit f45056d into twigjs:master Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants