open-engine / mika
Mika Framework
0.1.0
2019-01-12 21:17 UTC
Requires
- php: ~7.2
- ext-mbstring: ^7.2
- open-engine/di: ~0.1.0
- open-engine/helpers-path: ~0.1.0
- open-engine/http: ~0.1.0
Requires (Dev)
- doctrine/orm: ^2.6
- open-engine/run-tests: ~0.1.1
This package is auto-updated.
Last update: 2024-10-28 00:54:46 UTC
README
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)