Download the PHP package fullstackpe/micro without Composer

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

Micro

Latest Stable Version Build Status

Micro is a lightweight PHP router.

Installation

First you need to install Composer. You may do so by following the instructions at getcomposer.org. After that run

composer require fullstackpe/micro

If you prefer you can create a composer.json in your project folder.

How it works?

Micro use a php router. It matchs urls with PHP classes (Controllers).

Directory structure

To use a url like this: index.php?r=controllerName/viewName your directory structure should be:

To use a url like this: index.php?r=moduleName/controllerName/viewName your directory structure should be:

Please be note that the only directory that needs to be public is the web directory.

Application

The Application class is the single point of entry. The constructor have one parameter as an array where you can pass configuration key for example to setup a database connection.

For example:

Controllers

Controllers classes are stored in the controller directory and has to extends the core Controller class. A typical controller looks like this:

Views

Controllers are use for render views. Views are stored in a directory that has the same name of the controller inside the view directory.

The render function has two parameters: the name of the view file and the variables to be rendered in the view. The function will search for a render file with name equals to its first argument.

For example

Controllers are use for render views. Views are stored in a directory with the same name of the controller inside the view directory.

The render function has two parameters: the name of the view file and the variables to be rendered in the view. The function will search for a render file with name equals to its first argument.

For example

Will search for a view file named "home" in the controllers directory inside the view folder.

Running Micro

You can run micro with php Built-in web server. Run the following command:

php -S localhost:8080 -t web

Open localhost:8080 in your browser:

http://localhost:8080

Why micro?

The word micro is used in common-day Peruvian Spanish as an abbreviation for microbus (minibus). Micros race from one street corner to another along all the major arterial city roads. They run fast just like this framework.

alt text

Contribution

Feel free to contribute! Just create a new issue or a new pull request.

License

This library is released under the MIT License.


All versions of micro with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.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 fullstackpe/micro contains the following files

Loading the files please wait ....