PHPackages                             frosas/base-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. frosas/base-url-bundle

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

frosas/base-url-bundle
======================

Sets the router default base URL. It is required when the router is used while not dealing with a request (like in the console).

5419[1 PRs](https://github.com/frosas/BaseUrlBundle/pulls)PHP

Since May 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/frosas/BaseUrlBundle)[ Packagist](https://packagist.org/packages/frosas/base-url-bundle)[ RSS](/packages/frosas-base-url-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

**Notice [this functionality is already available in Symfony](http://symfony.com/doc/current/cookbook/console/sending_emails.html) since version 2.1**

---

This Symfony2 bundle **sets the router default base URL** (which by default is `http://localhost`)

It is required when absolute URLs are generated while not dealing with a request (like when sending an email from a cron job).

Installation and configuration
==============================

[](#installation-and-configuration)

1. Require it

    ```
    $ composer require frosas/base-url-bundle:1.*@dev
    ```
2. Register it in `app/AppKernel.php`

    ```
    $bundles = array(
        // ...
        new Frosas\BaseUrlBundle\FrosasBaseUrlBundle
    );
    ```
3. Set the base URL. This is the recommended usage:

    ```
    # app/config/config.yml
    frosas_base_url:
        base_url: %base_url%

    ```

    ```
    # app/config/parameters.yml
    parameters:
        base_url: http://example.com

    ```

Troubleshooting
===============

[](#troubleshooting)

- *Controller tests fail when using generated URLs*

    If you generate the URLs you test

    ```
    $client = self::createClient();
    $profileUrl = $client->getContainer()->get('router')->generate('profile', array('id' => 123);
    $client->request('get', $profileUrl);
    ```

    your tests can fail as the default Symfony test client expects the site to be in the root of the domain (like `http://example.com`). If your base URL has a path (like `http://localhost/~user/my-site`) you'll have to change it for you test environment.

    ```
    # app/config/config_test.yml
    frosas_base_url:
        base_url: http://localhost

    ```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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/cef3b9b80ec824a657958a5be429f3c7dbb31c3126120be491759731465b0696?d=identicon)[frosas](/maintainers/frosas)

---

Top Contributors

[![frosas](https://avatars.githubusercontent.com/u/50098?v=4)](https://github.com/frosas "frosas (22 commits)")[![eymengunay](https://avatars.githubusercontent.com/u/242627?v=4)](https://github.com/eymengunay "eymengunay (1 commits)")

### Embed Badge

![Health badge](/badges/frosas-base-url-bundle/health.svg)

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

###  Alternatives

[farhanwazir/laravelgooglemaps

Laravel Google Map package for 5.x. You can use all google map features in laravel.

15542.0k2](/packages/farhanwazir-laravelgooglemaps)

PHPackages © 2026

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