Universeorange.com/Docs/

R3m/framework Add route

The route to add is with a variable:

Open /project_dir/Host/<subdomain>/<hostname>/<extension>/Data/Route.json

add:

    "<subdomain>-<hostname>-<extension>-docs-page": {
        "path": "/Docs/{$page}",
        "host": [            
            "<subdomain>.<hostname>.<extension>"
        ],        
        "controller" : "<Subdomain>.<Hostname>.<Extension>.Docs.Controller.Page.get",
        "method": [
            "GET",
            "POST"
        ]
    }

Adding route with extra request

    "<subdomain>-<hostname>-<extension>-docs-page": {
        "path": "/Docs/{$page}",
        "host": [            
            "<subdomain>.<hostname>.<extension>"
        ],
        "request" : {
            "extra" : "extra"
        }, 
        "controller" : "<Subdomain>.<Hostname>.<Extension>.Docs.Controller.Page.get",
        "method": [
            "GET",
            "POST"
        ]
    }

Extra will be available in the controller through: $object->request('extra').
In the view through: {request('extra')}.

Next: Create the controller

Last modified: 2021-06-07

© 2021 universeorange.com