DEV Community

Cover image for New achivements of Mezon PHP Framework - August 2022
alexdodonov
alexdodonov

Posted on

3 2

New achivements of Mezon PHP Framework - August 2022

Hi! Today I'am going to continue posting news about Mezon Framework improvements.

Mezon Router bugfix

In 1.5.x version the bug was fixed for routers wich return false. In previous versions of router false value was traited like 'Route handler was not foud' what was obviously buggy behaviour.

$router = $this->getRouter();
$router->addRoute('/catalog/[a:cat_id]/', function (): bool {
    return false;
});

// test body
$result = $router->callRoute('/catalog/foo/');
Enter fullscreen mode Exit fullscreen mode

Earlier this code caused exception but now is working fine.

Mezon Router refactoring

Lots of duplicate code was removed.

Non-ASCII parameters were implemented in the Mezon Router

Non-ASCII parameters were implemented as was requested in this issue. Now this code works fine:

$router = $this->getRouter();
RouterUnitTestUtils::setRequestMethod('GET');

$router->addRoute(
     'кириллический-урл/[s:non-ascii-param]',
     function (string $route, array $params): string {
          return $params['non-ascii-param'];
     },
'GET');

var_dump($router->callRoute(urlencode('кириллический-урл/ни разу не ASCII - 日本語')));
Enter fullscreen mode Exit fullscreen mode

The bug in the Mezon Template Engine was fixed

1 bug in the Mezon Template Engine was fixed. I already don't remember what it was about. Just be sure - now it is less buggy )

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay