Download the PHP package scandio/lmvc without Composer

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

LMVC (cool)

Lean Model View Controller

This project contains a very small MVC framework written with simple PHP classes. It's not for production use but for learning purpose. It's developed with the following boundary conditions:

Currently there is no documentation for anything.

How To

You have to change the .htaccess file if you want to try it

RewriteRule ^(.*)$ /path/to/your/index.php?app-slug=$1 [L,QSA]

Controllers and actions

http:://host/base-path/controller/action/param1/param2

The URL above shows the controller & action with theirs params

http:://host/base-path/

is a special controller and a special action. In this case the controller is named Application and the action index()

http:://host/base_path/xyz

Here the controller is Xyz and the action is index()

http:://host/base_path/xyz/do

Again the controller is Xyz and the action is do()

To develop your own controller create a file with the same name like the class in the controllers directory

e.g. Accounts.php

Create a class as a descendant of class Controller

class Accounts extends \Scandio\lmvc\framework\Controller { }

Create a public static method named like the action you want to call

class Accounts extends \Scandio\lmvc\framework\Controller {

    public static function index() {
        print_r('ok');
    }

}

Try to call

http://host/base-path/accounts/

Rendering views

Currently LMVC supports two rendering options. First the standard HTML rendering. Second the JSON output. The class Controller is having two static methods for that. All data that have to be passed to the template or to JSON must be set by setRenderArg().

Example for HTML rendering:

class Accounts extends Controller {

    public static function index() {
        return self::render()
    }

}

This renders the view (template) registeredViewPaths/controller/action.html. In this case views/accounts/index.html. To pass some data to the template you can...

class Accounts extends \Scandio\lmvc\framework\Controller {

    public static function index() {
        self::setRenderArg('name', 'John Doe');
        return self::render()
    }

}

or

class Accounts extends Controller {

    public static function index() {
        self::render(array('name' => 'John Doe'));
    }

}

or both. There is no specific template language. It's just PHP. Every render argument is accessible as a local variable.

<h1>Hello <?= $name ?></h1>

Example for JSON rendering

class Accounts extends \Scandio\lmvc\framework\Controller {

    public static function index() {
        self::renderJson(array('name' => 'John Doe'));
    }

}

has an output like

{"name": "John Doe"}

All versions of lmvc with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 scandio/lmvc contains the following files

Loading the files please wait ....