PHPackages                             ys-tools/back-url-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ys-tools/back-url-bundle

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

ys-tools/back-url-bundle
========================

Symfony 2 Back URL Annotation

01.0kPHP

Since Apr 24Pushed 13y agoCompare

[ Source](https://github.com/yshyshkin/BackUrl)[ Packagist](https://packagist.org/packages/ys-tools/back-url-bundle)[ RSS](/packages/ys-tools-back-url-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony 2 Back URL Annotation
=============================

[](#symfony-2-back-url-annotation)

This bundle allows to manage automatic redirects according to URL parameters. To do this you should use special annotation @BackUrl for controller class or controller action.

To process redirect you should specify parameter name which contains redirect URL. In controller action code you can trigger back URL redirect in desired place, and redirect will be performed after processing of controller action.

If URL doesn't contain back URL parameters, there won't be performed any additional actions.

*Note:* Annotation for controller action has higher priority than annotation for controller class.

Installation
------------

[](#installation)

1. Add bundle name to "require" section in composer.json: `"ys-tools/back-url-bundle": "dev-master"`
2. Update composer packages: `composer update`
3. Register bundle in kernel (defaults - file app\\AppKernel.php, method registerBundles): `new YsTools\BackUrlBundle\YsToolsBackUrlBundle(),`

Parameters
----------

[](#parameters)

- **parameter**, *default name* (default: "backUrl") - name of the parameter which will be user to get back URL;
- **useSession** (default: false) - flag which specified that back URL will be stored in session until the redirect will be performed.

Examples
--------

[](#examples)

#### Controller Action Annotation

[](#controller-action-annotation)

This annotation will redirect user to URL specified in parameter "redirect" after processing of listAction controller action.

```
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use YsTools\BackUrlBundle\Annotation\BackUrl;

class BlogController extends Controller
{
    /**
     * @BackUrl("redirect")
     */
    public function postAction()
    {
        ...
        BackUrl::triggerRedirect();
        ...
    }
}
```

#### Controller Class Annotation

[](#controller-class-annotation)

This annotation will redirect user to URL specified in parameter "back\_to" after processing of controller action which triggers back URL redirect.

```
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use YsTools\BackUrlBundle\Annotation\BackUrl;

/**
 * @BackUrl("back_to")
 */
class BlogController extends Controller
{
    ...

    public function listAction()
    {
        ...
    }

    ...

    public function postAction()
    {
        ...
        BackUrl::triggerRedirect();
        ...
    }

    ...
}
```

#### Controller Action Annotation using Session

[](#controller-action-annotation-using-session)

This annotation will save back URL from parameter "href" in Session object and will perform redirect when user triggers back URL redirect. Back URL will be stored in Session object until back URL redirect will be performed.

```
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use YsTools\BackUrlBundle\Annotation\BackUrl;

class BlogController extends Controller
{
    /**
     * @BackUrl("href", useSession=true)
     */
    public function postAction(Request $request)
    {
        // form initialization...

        if ($request->isMethod('POST')) {
            $form->bind($request);
            if ($form->isValid()) {
                // save data to DB...

                BackUrl::triggerRedirect();

                return $this->redirect($this->generateUrl('blog_list'));
            }
        }

        return $this->render(
            'AcmeBlogBundle:Blog:post.html.twig',
            array('form' => $form->createView())
        );
    }
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3666adef66d5ffa6c15ee63486d2ece76ec973ec35e63feada871e9d191e8abb?d=identicon)[yshyshkin](/maintainers/yshyshkin)

---

Top Contributors

[![yshyshkin](https://avatars.githubusercontent.com/u/3470882?v=4)](https://github.com/yshyshkin "yshyshkin (4 commits)")

### Embed Badge

![Health badge](/badges/ys-tools-back-url-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ys-tools-back-url-bundle/health.svg)](https://phpackages.com/packages/ys-tools-back-url-bundle)
```

###  Alternatives

[log1x/laravel-webfonts

Download, install, and preload over 1500 Google fonts locally in your Laravel project

142101.9k3](/packages/log1x-laravel-webfonts)[abdelhamiderrahmouni/filament-monaco-editor

A monaco editor form field for filamentphp.

19187.6k](/packages/abdelhamiderrahmouni-filament-monaco-editor)[alleyinteractive/wp-captain-hook

Tools for manipulating private action/filter callbacks in WordPress.

12257.4k](/packages/alleyinteractive-wp-captain-hook)[helori/laravel-seo

SEO tools to insert meta and structured-data in laravel projects

124.9k](/packages/helori-laravel-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
