Download the PHP package webiny/bootstrap without Composer

On this page you can find all versions of the php package webiny/bootstrap. 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 bootstrap

Bootstrap Component

Bootstrap is the first piece of code your web application runs. It loads all system components, and then runs your application. The component uses MVC application architecture. Note that Webiny Framework is not an MVC framework, rather it's a set of modular components that you can use in various different application architectures, for example like HMVC and others.

However, we decided to create this component, so that it helps other developers, that are mostly familiar with MVC, to use Webiny Framework in their projects.

Install the Component

The best way to install the component is using Composer.

For additional versions of the package, visit the Packagist page.

Requirements

The component requires that you follow a specific file-folder structure.

A skeleton app can be found here Bootstrap Skeleton App.

A more advanced demo application can be found here Bootstrap Todo Demo App.

Application Namespace

Once you have your structure in place, you need to set your desired application namespace inside the Config/App.yaml file.

The Namespace defines the class root namespace for your module.

Modules

Every module is placed inside the Modules folder inside the skeleton app. The module name should be written in CamelCase, e.g. "MySuperAwesomeModule".

Controllers

The Controllers folder, which is inside your module folder, holds your controller classes. Controller name must also be written in CamelCase. Every controller class must use the Webiny\Component\Bootstrap\ApplicationTraits\AppTrait trait.

AppTrait

The AppTrait gives you access to the app method, which then provides access to various helper methods.

There are also couple of View helper methods:

These setter methods, have also a getter pair, for outputting the result:

Controller Actions

Every controller exposes certain public method that can be accessed over url. The method name of these methods must end with Action keyword. Eg doSomethingAction.

Views

Every controller has it's own view folder, that holds the view templates for controller actions. The view folder name, must match the controller class name.

The requirements for the view template name are:

By default, the Bootstrap component uses the TemplateEngine component, which uses Smarty template engine.

Environments and Configuration Files

Within the Config folder, you have the Production folder, which must always exist. This is the location from where the component reads the configuration files. However, you can have additional folders, alongside the production one, that hold environment-specific configurations. The Production config files are always loaded, the additional env-specific config files, just overwrite the production config variables.

To create an environment, you need to first define it inside the Config/App.yaml config file:

The Domain parameter defines when a certain environment will be loaded. The environment name, defines the folder that will hold the configuration files. You can have as many environments as you want.

If the Domain, for the upper example, matches the current hostname, the component will first load all the config files, from the Production folder, and then all the files from the Development folder, and then it will merge both configurations into one.

System Configurations

Almost every component within Webiny Framework, takes a configuration file. That file defines the initial component data, and how the component should be constructed.

The Bootstrap component handles this initialization process automatically. If you create a configuration file, with a name matching a Webiny Framework component, the component will be initialized upon the application boot time and will be immediately available for usage in your application code.

Checkout the Config folder inside the Bootstrap Todo Demo App.

Routing

By default the component uses standard MVC routing. For example, a request looking like this: www.myapp.com/HelloWorld/Foo/sayHi/ would match the following:

The upper url, can also we written in lowercase with hyphens www.myapp.com/hello-world/foo/say-hi/. This would match the same module-controller-action.

Custom Routes

To define custom routes, just create a Router.yaml config file, inside your environment. This file should follow the Router Component setup. The Bootstrap component will automatically pick up all the defined routes and do the matching. If a custom route is not matched, Bootstrap will do a fall-back to the default MVC router.

This is an example how a custom route should be defined.

Passing Parameters

If an action method, takes one or more parameters, you can pass them inside the url path.

For example, let's say you have the following action method:

You can pass the parameters like this: www.myapp.com/hello-world/foo/say-hi/Jack/, which would output:

Hi Jack, from Planet Earth

or like this: www.myapp.com/hello-world/foo/say-hi/Jack/Hawaii, which would output:

Hi Jack, from Hawaii

Resources

To run unit tests, you need to use the following command:

$ cd path/to/Webiny/Component/Bootstrap/
$ composer.phar install
$ phpunit

All versions of bootstrap with dependencies

PHP Build Version
Package Version
Requires php Version ^7
webiny/std-lib Version ~1.6
webiny/config Version ~1.6
webiny/class-loader Version ~1.6
webiny/http Version ~1.6
webiny/router Version ~1.6
webiny/template-engine Version ~1.6
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 webiny/bootstrap contains the following files

Loading the files please wait ....