Download the PHP package elendev/widget-bundle without Composer

On this page you can find all versions of the php package elendev/widget-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 widget-bundle

ElendevWidgetBundle

The ElendevWidgetBundle allow to add widgets (independent HTML code) into existing templates withouth dependencies.

Installation

The ElendevWidgetBundle is available through composer. You just have to add elendev/widget-bundle into your composer.json.

Configuration

elendev_widget:
    enable_annotations:   true # false : disable annotation support
    scan_services:        true # false : don't check annotations on services
    scan_widget_directory:  true # false : don't scan Widget directory
    widget_directory:     'Widget' # name of the widget directory at bundle's root
    hinclude:
        force: none                 # Force use of hinclude
                                    # none       : use widgets to load synchronous widget, widgets_async to load them asynchronously
                                    # enabled    : force widgets method to load asynchronously using hinclude
                                    # disabled   : force widgets_asynch method to load synchronously

Register a new widget

A widget is a service method returning simple HTML code. You only have to tag your service method with :

tags:
        - {name: elendev.widget, tag: your_tagname, method: method_name, priority: optional_integer_priority}

Annotations are also available, you can annotate any method of a service or of a class in widget_directory sub-directory.

namespace Acme\DemoBundle\Widget;
use Elendev\WidgetBundle\Annotation\Widget;

class MyTestWidget {
    /**
    * @Widget(tag="main", priority=99)
    */
    public function myYoupiWidget(){
        return "This is a simple widget";
    }
}

The value of widget is by default the tag value. Widgets in widget_directory sub-directory are instanciated as services and support the ContainerAwareInterface interface (container is automatically injected).

Use Twig's extension widget method

To include widgets in a view you only have to call this method :

{{ widgets('your_tagname') }}

It's possible to use hinclude :

{{ widgets_async('your_tagname') }}

BE CAREFUL : only scalar parameters can be passed to widgets_async method. To enable hinclude, please refer to symfony's documentation : http://symfony.com/doc/current/book/templating.html#asynchronous-content-with-hinclude-js.

You can add multiple widgets emplacements in your project, specifieds by their tagname.

Some widget's emplacements can provide parameters. You can add as much parameters as you need to widgets call, they will be passed to the widget.

#services.yml
services:
    my_service:
        class: Some/Class/MyWidgets
            tags:
                - {name: elendev.widget, method: memberDatas, tag: member_profile}

{# Template twig #}
{{ widgets('member_profile', member) }}

//PHP code
class MyWidgets{
    public function memberDatas(Member $member){
        return 'some templates';
    }
}

All versions of widget-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version ~2.1|~3.0
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 elendev/widget-bundle contains the following files

Loading the files please wait ...