2017 © Pedro Peláez
 

library movetobundle

Generate paths without having to restate every parameter in the current one.

image

kookas/movetobundle

Generate paths without having to restate every parameter in the current one.

  • Friday, February 17, 2017
  • by Kookas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

MoveToBundle

MoveToBundle for Symfony and Twig lets you generate paths to routes by copying all the parameters of the current route and applying them to another route with the option of modifying all or only some of those parameters. No more extremely long path() calls!, (*1)

To install, use composer require kookas/movetobundle and then insert the line new Kookas\MoveToBundle\KookasMoveToBundle() into your AppKernel.php file. Alternatively, you can simply download the bundle straight from the repository and use that., (*2)

To use, call the Twig function moveTo(params, route = null). This will generate a path from the current route parameters combined with the parameters provided in the first argument, with your parameters taking precedence where conflicts arise. By default, the route used is the current route, but you can specify a different one by name in the second argument., (*3)

For example, suppose I have a blog system that lets any user set up a blog and make blog posts, which can then have paginated comments. The URI for the comments of a blog post might look like this:, (*4)

/blogs/myblog/top-10-healthy-foods-in-existence/comments/page-1, (*5)

If I want to make a button to go to page-2, not only would I normally have to specify the current route again, but I'd also have to respecify both the blog name and the post slug in path(). With MoveToBundle, you can just do this:, (*6)

{{ moveTo({'page':2}) }}, (*7)

The Versions

17/02 2017

dev-master

9999999-dev

Generate paths without having to restate every parameter in the current one.

  Sources   Download

MIT

by Ashleigh Udoh

route symfony routing

17/02 2017

v1.1.1

1.1.1.0

Generate paths without having to restate every parameter in the current one.

  Sources   Download

MIT

by Ashleigh Udoh

route routing

13/02 2017

v1.1.0

1.1.0.0

Generate paths without having to restate every parameter in the current one.

  Sources   Download

MIT

by Ashleigh Udoh

route routing

13/02 2017

v1.0.3

1.0.3.0

  Sources   Download

13/02 2017

v1.0.2

1.0.2.0

  Sources   Download

13/02 2017

v1.0.1

1.0.1.0

  Sources   Download

13/02 2017

v1.0.0

1.0.0.0

  Sources   Download