Download the PHP package dawidgorecki/litemvc without Composer

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

LiteMVC PHP framework

GitHub (pre-)release GitHub license

This is a simple MVC framework for PHP 7.1.0 and later.

Minimum Requirements

Usage

  1. Install LiteMVC framework on your machine.
  2. Run composer update to install the project dependencies.
  3. Enter your configuration data in a specified files.
  4. Configure your web server.
  5. Add routes, create controllers, views and models.

Installation

There are a few ways to install this framework.

Configuration

Configuration files are stored in the Application/Configs directory. Default settings include database connection setting, SMTP configuration and some others. You can access the settings in your code like this: Config::get('DB_HOST'). Also you can add your own configuration settings in here.

For development environment, file config-production.php is used on production environment.

To change environment add one of the following instruction in bootstrap.php file.

Naming convention

Web server configuration

Configure your web server to have the Public folder as the web root. Also add or update ServerAdmin variable in vhost configuration file. This will be used on the error pages.

Routing

The routes.php file in the Application/Configs directory.

Routes are added with the add method. You can add fixed URL routes, and specify the controller and action:

Or you can add route variables, like this:

You can specify any parameter you like within curly braces.

Controllers

Controllers are stored in the Application/Controllers folder. Controllers are classes that extend the Controller.php class, and need to be in the Controllers namespace. You can put any controller in subdirectory, but then you need to specify the namespace when adding route for these controller.

Controller has two special methods executed before and after any other actions:

Getting model and view:

Model with the same name as controller is loaded automatically. You can load another models:

Views

Views are used to display information (usually HTML). View files are in the Application/Views folder and should be a Smarty template file (*.tpl). You can find some examples with bootstrap components in Application/Views dir.

Rendering view:

Getting view as PDF file:

You can use View static methods to check witch controller and action is active:

Models

Models are used to get and store data in your application. Models extend the Model.php class and use PDO to access the database. They're stored in the Application/Models folder.

Example of database usage:

Model private properties should have the same names as columns in database table if you want to use ActiveRecord features (CRUD).

Basic CRUD

Create

To create a new record in database (e.g. add new user) we instantiating a new object (model) and then invoking the save() method.

Read

These are your basic methods to find and retrieve records from your database.

Update

To update you would just need to find a record first and then change one of attributes.

Delete

That will call SQL query to delete the record in your database.

Number of rows in table

Captcha

You can create and add captcha image to the page by using this code:

Generated phrase will be stored in the session variable captcha. You can change some settings in the CaptchaController.php file.

To reload captcha use this code:

You can compare the phrase with user input:

Emails

To send email message use this code. Be sure you are changed SMTP configuration in config file.

Logs & Errors

All errors are reporting and saved in file defined in configuration file. Default location is /Logs/error.log.

You can add log by using this code:

Error Views are stored in Application/Views/Templates/Errors folder.

You can render error View with following code:

License

Licensed under the MIT license. (http://opensource.org/licenses/MIT)


All versions of litemvc with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
smarty/smarty Version ~3.1
phpmailer/phpmailer Version ~6.0
spipu/html2pdf Version ^5.1
gregwar/captcha Version 1.*
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 dawidgorecki/litemvc contains the following files

Loading the files please wait ....