Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Custom parameters passing #134

@Pok4

Description

@Pok4
  • PHPRouter version: 1.2alpha
  • PHP version 8.1

Hi again, guys :)

I started a topic in stackoverflow for my previous problem and there is some replies: https://stackoverflow.com/questions/71241075/php-8-unknown-named-parameter-dannyvankooten-router/71241345?noredirect=1#comment125927353_71241345

They told me to remove this line from code:
'parameters'=> ['template_file'=>'ajax'],

to my script start working, but this is so important ...
I started this one to give a suggestion to making edit in router code to start working like this :)

This is important, because i use template engine mustache and i pass the variables like this:
$tpl = $mustache->loadTemplate(get_object_vars($route)['_config']['parameters']['template_file']);

and this:
$tpl = $mustache->loadTemplate($route->getParameters()['template_file']);

both working in php 5.4> and <php7.4

Without this ones i'm lost and my CMS can't working... This is very important...
Its so easy to set a template file in routes and to catch this one from my template system... It's very clear and pleasant way..
If you help me to start this working i will be very happy :)

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions