Mika Framework

0.1.0 2019-01-12 21:17 UTC

This package is auto-updated.

Last update: 2024-10-28 00:54:46 UTC


README

Build Status Latest Stable Version Code Quality Code intelligence Powered By Mika License

Mika

Mika PHP Framework

Templates

https://github.com/open-engine/mika-project-template

Misc

To start tests run

bin/tests

Route

$routeConfig = new RouteConfig();
$routeConfig->register('default','App\Main\Controllers');

Controller

namespace App\Main\Controllers;

use App\Main\Models\Foo;
use Doctrine\ORM\EntityManagerInterface;
use OpenEngine\Mika\Core\Components\Http\Message\Response\Response;

/**
 * Class DefaultController
 * @package App\Main\Controllers
 */
class DefaultController
{
    /**
     * @return Response
     */
    public function defaultAction(): Response
    {
        return new Response('Hello World!');
    }
    /**
     * @param EntityManagerInterface $em
     * @param int $id
     * @return Response
     */
    public function fooAction(EntityManagerInterface $em, int $id): Response
    {
        $em->getRepository(Foo::class)->find($id);
        
        // ... code....

        return new Response('Doctrine Test');
    }
}

Events

Route has 2 events - before and after calling controller action

BeforeCallActionEvent::class;
AfterCallActionEvent::class;

There is you can find all Events. Link (todo)