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

Added initial inline js routing functionality #23

Closed
wants to merge 4 commits into from

Conversation

Josiah
Copy link

@Josiah Josiah commented Mar 22, 2013

Compiles routing information to inline js closures negating the need to use an external js routing library.

This PR is a work in progress and isn't ready to be merged yet.

@Josiah
Copy link
Author

Josiah commented Mar 22, 2013

See #22 for the original idea. Comments on the implementation would be appreciated.

This PR still needs:

  • A way to turn off the inline routing
  • Support for the url function
  • Route parameter checking

if ($routeNode instanceof Twig_Node_Expression_Constant) {
$routeName = $routeNode->getAttribute('value');
} else {
$compiler
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looking at this, I think it would make sense to instead fallback to the default compilation in cases where the route name is dynamic.

We could add some sort isHandled(\Twig_Node $node) function to the FunctionCompilerInterface. What do you think?

@Josiah
Copy link
Author

Josiah commented Dec 14, 2015

PR is ancient - cleaning up

@Josiah Josiah closed this Dec 14, 2015
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