2017 © Pedro Peláez
 

library karinto

a minimal web application framework

image

karinto/karinto

a minimal web application framework

  • Friday, October 19, 2012
  • by hiro_y
  • Repository
  • 1 Watchers
  • 8 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Karinto

Karinto is a minimal application framework for PHP 5.3 or later inspired by Silex based on Lune., (*1)

Required

  • PHP 5.3 or later
  • mbstring

Optional

You can use Twig as a template engine instead of using plain PHP templates., (*2)

Usage

/index.php

<?php
require_once 'Karinto.php';

use Karinto\Application;
use Karinto\Request;

$app = new Application();
$app->templateDir = 'templates';

// if using Twig
// $app->useTwig(array('cache' => 'cache'));

$app->error(function($code, \Exception $e = null) use ($app) {
    switch ($code) {
    case 404:
        $app->render('error_404.php');
        break;
    default:
        $app->render('error_general.php');
        break;
    }
});

$app->get('/', function(Request $req) use ($app) {
    $app->render('default.php');
});

$app->get('/foo', function(Request $req) use ($app) {
    $app['name'] = $req->param('name');
    $app->render('foo.php');
});

$app->get('/bar', function(Request $req) use ($app) {
    $session = $app->session();
    $session['name'] = $req->param('name');
    $app->redirect('/baz');
});

$app->run();

/templates/foo.php

<html>
<body>
<p><?php echo h($name); ?></p>
</body>
</html>

Please access "/index.php/foo?name=bar", (*3)

License

This code is free to use under the terms of the New BSD License., (*4)

With Composer

If using Composer as a dependency management tool, you can bring Karinto in your environment easily with settings below., (*5)

{
  "minimum-stability": "dev",
  "require": {
    "karinto/karinto": "1.0.*"
  }
}

Using Twig with Karinto, you should set as the same below:, (*6)

{
  "minimum-stability": "dev",
  "require": {
    "karinto/karinto": "1.0.*",
    "twig/twig": "1.*"
  }
}

The Versions

19/10 2012

dev-master

9999999-dev https://github.com/hiroy/karinto

a minimal web application framework

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3
  • ext-mbstring *

 

microframework