Comments (7)
Maybe it's your sever configuration problem and you should add .htaccess
on your project root folder.
If you want to share SFTP access to me, please email me, thanks :).
from php-router.
Sorry. I run your PHP codes and it's worked successfully.
Here are my code snippets:
<?php
require 'path/to/vendor/autoload.php';
use Buki\Router;
$router = new Router();
$router->pattern(':key', '[a-z0-9]+');
$router->pattern(':oferta', '[a-z0-9.-]+');
$router->get('oferta/:key/:oferta', function($key, $nombre) {
return 'key, oferta route with custom patterns';
});
$router->run();
from php-router.
Sorry. I run your PHP codes and it's worked successfully.
Here are my code snippets:
<?php require 'path/to/vendor/autoload.php'; use Buki\Router; $router = new Router(); $router->pattern(':key', '[a-z0-9]+'); $router->pattern(':oferta', '[a-z0-9.-]+'); $router->get('oferta/:key/:oferta', function($key, $nombre) { return 'key, oferta route with custom patterns'; }); $router->run();
Do you think it is a php or my server configuration problem?
On localhost if it works, it is probably that, but I don't know what the technical requirements of the plugin are.
I can share you SFTP access if necessary. :/
from php-router.
Here is my router configuration:
$params = [
'paths' => [
'controllers' => 'controllers/',
],
'namespaces' => [
'controllers' => 'Controllers\\',
],
'base_folder' => __DIR__,
'main_method' => 'main',
];
$router = new Router($params);
I have no middleware to use on this application.
from php-router.
@NeftaliAcosta , Do you still have any problem about that?
from php-router.
Do you still have any problem about that?
Hi, Thanks for your time. Yes, all the Middleware routes still do not work for me, I keep testing my site.
Is it normal that I have to comment on this part of the code for the plugin to work on my site in Router.php?
/**
* Run Routes
*
* @return void
* @throws
*/
public function run()
{
$base = str_replace('\\', '/', str_replace($this->documentRoot, '', $this->runningPath));
$uri = rtrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
/*
if ($_SERVER['REQUEST_URI'] !== $_SERVER['PHP_SELF']) {
$uri = str_replace(dirname($_SERVER['PHP_SELF']), '', $uri);
}
if (($base !== $uri) && (substr($uri, -1) === '/')) {
$uri = substr($uri, 0, (strlen($uri) - 1));
}
*/
}
from php-router.
Could you share $_SERVER variable values by using var_dump or something else?
We should debug that problem on your side because i couldn't reproduce the problem on my side. (local and prod)
from php-router.
Related Issues (20)
- Url Generation HOT 1
- Router not working for windows servers HOT 1
- How to group links with optional parameter HOT 8
- BackendIndexController class is not found. Please check the file. HOT 1
- How to views file HOT 6
- How to define http method type for main path in controller HOT 1
- Is there any way to serve public directory without /public/ ? HOT 2
- v2.3.4 ile kütüphane çalışmaz oldu HOT 8
- Request Sorunu HOT 7
- Route Hata yakalama HOT 1
- Controller groups HOT 5
- Looks like page not found or something went wrong. Please try again. HOT 13
- [FEATURE] providing swoole http server HOT 1
- cache HOT 5
- Add routing react or vue etc. HOT 2
- Route plugins HOT 4
- WebController class is not found. Please check the file. HOT 1
- how to use cache feature ??
- Subdomain Control Issue
- Router Group kullanarak urlye dil sistemi ekleme HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-router.