Download the PHP package ibnusyuhada/slim-tegar without Composer

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

Latest Stable Version License

Slim Tegar

Slim Tegar is a package that designed for integrating PHP-DI and Slim Framework version 3.x.x. This package is an Slim Bridge advanced. You don't need to exteds just to make container configuration. Slim Tegar also providing the easy way to implement Closure and MVC routes.

Requirement

Slim Tegar requires PHP-DI and SlimFramework version 3.x.x.

Installation

Install Slim Tegar can do via Composer:

Usage

Basically, Slim Tegar is replacing original container of Slim (Pimple) with PHP-DI. You don't need to extend any class just for configuration dependencies. Some advance usage has been added to polish up original integration in http://php-di.org/doc/frameworks/slim.html.

Basic Usage

Slim Tegar usage is simple and easy. Initially, create an example project, let say slimtegar. Then install Slim Tegar inside that. After that, create index.php with the following simple code:

Basic Usage Controller

When you want to implement MVC pattern, Slim Tegar providing the simple way to register all controllers. First, add the following code before $app->run() method:

second, open composer.json then put the code below:

don't forget to dumpautoload for register this namespace in composer. Third, create a directory inside slimtegar project with controllers as the name. Then create ExampleController.php file inside controllers directory with the following code:

fourth, open your lovely browser, and access URI example.

Configurations

In Slim Tegar, configuration was made easy. You don't need to extends any class of Slim or PHP-DI. What you need just create a directory, then put all your configuration files inside it. Basically, Slim Tegar has mandatory configuration directory. The name of the directory is defaultConfiguration. Inside there, you will see two files: defaultConfiguration.php and settings.php. The meaning of settings.php is same definition like in Slim (see [http://www.slimframework.com/docs/tutorial/first-app.html]) and PHP-DI (see [http://php-di.org/doc/frameworks/slim.html]). In updating settings, however, you don't need to touch these files. What you need just create another directory in your project, let say the name is config, then create a php file inside there. Let we give the name of that file as config.php then give the following code:

the code above will update displayErrorDetails and add new item of settings. After that, tell Slim Tegar where the config directory is placed. Here the example code inside index.php

Add Dependencies

If you want to add another dependencies, however, just create a file returning an array (see http://php-di.org/doc/php-definitions.html), then put that file in config directory, after that Slim Tegar will register the dependencies automatically for you. As example, let say we want to use Slim-Twig. First, install Twig for Slim:

Second, create a file returning an array inside config directory. Let say the name of that file is view.php. Then give the following code in that file:

Third, inject the Twig service in controllers or closure. Below is the example:

don't forget to create home.twig file by your self.

What Next?

Everything what you need to use Slim Tegar is just follow SlimFramework Documentation. The different now is how the way you use dependency injection container. You are not using Pimple anymore, but PHP-DI. So, read more documentation about PHP-DI Documentations for advance usage. For more understanding, see the example usage inside Slim Tegar package.

Credits

Ibnu Syuhada

License

The MIT License.


All versions of slim-tegar with dependencies

PHP Build Version
Package Version
Requires slim/slim Version ^3.5
php-di/php-di Version ^5.3
php-di/invoker Version ^1.3
php Version >=5.5
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 ibnusyuhada/slim-tegar contains the following files

Loading the files please wait ....