2.1.1 • Published 1 year ago
fmihel-php-router-client v2.1.1
php-router
simple php router
Install
Server side
composer require fmihel/php-router
Client side
npm i fmihel-php-router-client
Simple use
create index.js
import router from 'fmihel-php-router-client';
router({
id:'MSG_SEND',
data:{ msg: 'send msg to server',any_num:10,arr:[1,32,4,2]},
})
.then(data=>{
console.info(data);
})
.catch(e=>{
console.error(e);
})
create mod1.php
<?php
class Mod1 extends fmihel\router\Route{
public function route_MSG_SEND($from){
error_log(print_r($from,true));
return $this->ok("send Ok on response MSG_SEND");
}
}
?>
create index.php
<?php
require_once __DIR__.'/vendor/autoload.php';
new \fmihel\router\Router([
'add' =>['mod1.php'],
'suspend' =>false,
]);
?>
2.1.1-beta.12
1 year ago
2.1.1-beta.13
1 year ago
2.1.1-beta.11
1 year ago
2.1.1-beta.1
2 years ago
2.1.1-beta.2
2 years ago
2.1.1-beta.10
1 year ago
2.1.1-beta.3
2 years ago
2.1.1-beta.4
2 years ago
2.1.1-beta.5
2 years ago
2.1.1-beta.6
2 years ago
2.1.1-beta.7
2 years ago
2.1.1-beta.8
2 years ago
2.1.1-beta.9
1 year ago
2.1.1
3 years ago
2.0.2
3 years ago
2.1.0
3 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago
0.1.0
4 years ago