Download the PHP package alexandresalome/web-bundle without Composer

On this page you can find all versions of the php package alexandresalome/web-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package web-bundle

[DEPRECATED] AlexWebBundle

I recommend you to pick snippets in the code, but not to use it actually (very unstable).

Installation

Add alexandresalome/web-bundle to your composer.json:

{
    "require": {
        "alexandresalome/web-bundle": "dev-master"
    }
}

Updates your dependencies and add it to your AppKernel:

public function registerBundles()
{
    return array(
        // ...

        new Alex\WebBundle\AlexWebBundle()
    )
}

Base controller

Controller from this bundle provides a bunch of useful methods.

Take a look at the class for an exhaustive feature list.

Data Fixtures

namespace Acme\DemoBundle\DataFixtures\ORM;

use Alex\WebBundle\DataFixtures\ORMFixture;
use Doctrine\Common\Persistence\ObjectManager;

class UserData extends ORMFixture
{
    public function load(ObjectManager $manager)
    {
        // access a container service
        $this->get('security.encoder_factory');
    }
}

Form templating

Twitter Bootstrap 3.0 templating is available in this bundle for forms. In Twig configuration, add form templating:

twig:
    form:
        resources: [ "AlexWebBundle::form_bootstrap3_layout.html.twig" ]

Locale listener

If you want to allow user to choose locale in a given set, you can turn on the locale listener by appending in your config.yml file:

alex_web:
    locale_listener: [ fr_FR, en_US, pt_PT ]

This configuration will constraint the user locale on one of those. Default behavior is to store this locale in session. If you don't want to use session but still want to use the listener:

alex_web:
    locale_listener:
        enabled: true
        locales: [fr_FR, en_US]
        session_key: null # disable persistence in session

Twig extension :::::::::::::

|format_interval

Example:

Duration: {{ job.finishedAt.diff(jobStartedAt) }} {# should be job.duration #}

This method will transform DateInterval object to a string representation.

Pagination template ::::::::::::::::::

If you are using my pagination library, you might appreciate the template AlexWebBundle::pagination.html.twig. To use it:

{% embed "AlexWebBundle::pagination.html.twig" %}
    {% block colspan '3' %}
    {% block head %}
        <th>Username</th>
        <th>Fullname</th>
        <th>Actions</th>
    {% endblock %}
    {% block body %}
        {% for user in pager %}
            <tr>
                {# ... #}
            </tr>
        {% else %}
            <tr><td colspan="{{ block('colspan') }}"><em>no user</em></td></tr>
        {% endfor %}
    {% endblock %}
{% endembed %}

Form extra widgets :::::::::::::::::

Form sections

Structure your form with sections. Sections will group fields with a legend above, so that your form is more structured:

$builder
    ->add($builder->create('informations' 'form_section')
        ->add('firstname', 'text')
        ->add('lastname', 'text')
    )
    ->add($builder->create('contacts', 'form_section')
        ->add('main', 'contact')
    )

Form tabs

Here is an example of a form with tabs:

$builder = $this->get('form.factory')->createBuilder('form_tabs');

$builder
    ->add($builder->create('informations', 'form_tab')
        ->add('firstname', 'text')
        ->add('lastname', 'text')
    )
    ->add($builder->create('contacts', 'form_tab')
        ->add('main', 'contact')
    )
;

All versions of web-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version ~2.3
php Version >=5.3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alexandresalome/web-bundle contains the following files

Loading the files please wait ....