Answer the question
In order to leave comments, you need to log in
What micro modular php engine would you recommend for learning the internals?
I need to understand the logic of modular architecture. In order not to step on a rake, I would like to consider a micro engine, since there should not be much that is superfluous in the case of large cms. Please advise engines with adequate architecture, which could at least be equal to. Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Let me send you to google with a slightly modified question , guided by the following argument that 90% of problems are solved using templates and spending time on bicycle building even for self-study purposes is highly discouraged, because studying architecture in general - you will solve more problems and build your own "microengine" in a couple of days, after understanding the basics of design.
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
class Extension1
{
public function renderContent()
{
return "Hello";
}
}
class Extension2
{
public function renderContent()
{
return "Word!";
}
}
class MicroApp
{
private $extensions;
public function __construct($extensions)
{
foreach ($extensions as $extension) {
$this->extensions[] = new $extension();
}
}
public function run()
{
echo "<!DOCTYPE html>";
foreach ($this->extensions as $extension) {
echo htmlspecialchars($extension->renderContent(), ENT_COMPAT, 'UTF-8', true) . " ";
}
echo "</html>";
}
}
$app = new MicroApp([
'Extension1',
'Extension2',
]);
$app->run();
If you don’t step on the rake yourself, you won’t be able to learn anything.
So your task is rather to do it not like everyone else, but in your own way, and therefore redo it as it should
simplemvcframework.com on gihab has examples.
https://github.com/panique/mini
as an option, start a framework without a framework and then build your own version of the engine
Take a look at Monstra - it's probably easier than ever :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question