• 0
Likes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/post.php

Line Number: 190

Backtrace:

File: /home2/naijacod/public_html/application/views/post.php
Line: 190
Function: _error_handler

File: /home2/naijacod/public_html/application/controllers/Posts.php
Line: 420
Function: view

File: /home2/naijacod/public_html/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Path is a PHP Framework developed by a Nigerian

From the official website:

Path is an API-first PHP framework crafted for javascript.

Path was built to work with Javascript out-of-the-box. it is more Suitable for PWA and MVC modern web apps, can also be used to build ‘just’ API for your existing App.

Path simplifies development by avoiding over-engineering and excessive abstraction.

The backbone of every application is; having a programmable interface for it, which may be consumed/used by your App or a third-party App.

To create an API you need a router that would be listening to a particular Route(or URL) and appropriate action may be taken and a response can be returned(shown) to the user.

you can listen to your preferred URL(Route) with Path’s Router, for example:

You initiate the use of the router

<?php

use PathCoreHttpRouter;

$router = new Router();

 

proceed to listen to a request

<?php

 use PathCoreHttpRouter;

 $router = new Router();

 $router->get("/your/custom/route",function(){
     //do something here
  });

 

The code above does two things; the first is to listen for GET request to /your/custom/route(i.e., http://yourproj.dev/your/custom/route) while the second is to execute a particular function / class method.

Path can also match dynamic URL as seen below

<?php

 use PathCoreHttpRouter;

 $router = new Router();

 $router->get("/user/@id/profile",function(){
     //do something here
  });

Regular expressions are also a valid parameter in URL using the format shown below

<?php

 use PathCoreHttpRouter;

 $router = new Router();

 $router->get("/user/@id:[d]+/profile",function(){
    //[d]+ enforces @id to be a digit of at least one character
     //do something here
  });

 

Developer: Sulaiman Adewale

You can read more about this awesome framework at https://path.adewale.dev/