Download the PHP package sokil/frontend-bundle without Composer

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

Frontend Bundle

Single Page Application based on Backbone, Marionette and Twitter Bootstrap

Total Downloads Build Status

Installation

Add composer dependency:

Add bundle to AppKernel:

Build resources:

Bundle uses assetic so you need to register it in assetic config:

You can use DeployBundle to handle process of deployment static resources.

Controller

Single Page Application

We may configure pre-defined controller, responsible for rendering single page application, as service:

Or use your own controller:

See how to convigure spa in view SiteBundle:Spa:index.html.twig below in View section .

If some additional data required to be passed from backend to frontend, this may be done through Application data.

Application data

Application data may be used to pass some data from backend to frontend. Create service, responsible for obtaining application data from different sources:

Now pass name of this service to definition of your spa action:

Application data generated from number of providers. provider is a servise identified by tag frontend.spa.app_data_provider. Also app data service must be defined by key app_data, pointing to the instance of application data service.

Provider class must implement Sokil\FrontendBundle\Spa\ApplicationDataProviderInterface. It must implement one method getData() which return map of application parameters.

Model

Handling json requests

Backbone models send json requests.

To enable support, you may add FOSRestBundle, and configure serializer. app/AppKernel.php:

app/config/config.yml:

It you don't need whole bundle, just register listener, which converts json request to array:

View

Template

View renders Marionette 2 application and starts it. Bootstrap 3 used as UI framework. For adding some CSS and JS resorses on page, use macro from src/Resources/views/macro.html.twig:

Regions

Application refers to the root app.rootView view , which handles root element of the SPA application. Root element may be configured in app options or used default value body. Root element holds some regions where different functinnality rendered. Main contebnt renders to app.rootView.content region, and popup renders to app.rootView.popup region. You can pass your own regions and refers to them through app.rootView:

Router

Router is instance of Backbone.Router. Also you can use Marionette.AppRouter.

If you have few routes, you can pass them all in routers option:

To set default route, use option defaultRoute:

Service container

Container is a registry to build and get already built services. Service definition is just an object with methods to build service instances, where this refers to Container instance:

Definitions passed to container by serviceDefinitions configuration parameter:

Services then may be get from container:

RequireJs

Dependencies may be merged and passed to container:

Every config may math one or both path and shim parameters:

By default, Application already has pre-configured FrontendRequireJsConfig. It has some dependencies, e.g. Twitter Typeahead.

Frontend Components

Popup

Popups must extend PopupView:

List

This component allows to generate collection of models.

MultiTypeahead

Wraps ListView, and adds typeahead functionality to add new elements to list.


All versions of frontend-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0
symfony/framework-bundle Version 2.*
friendsofsymfony/rest-bundle Version ~1.7 || ~2.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 sokil/frontend-bundle contains the following files

Loading the files please wait ....