Compare commits

..

2 Commits

2 changed files with 4 additions and 4 deletions

View File

@ -109,12 +109,12 @@ function sortBy(column) {
for (let i = 1; i < (rows.length - 2); i++) { for (let i = 1; i < (rows.length - 2); i++) {
let x = rows[i] let x = rows[i]
let rowXId = x.id let rowXId = x.id
let rowXNumber = rowXId.charAt(rowXId.length -1) let rowXNumber = rowXId.match(/\d+/)
let valueX = document.getElementById(column + '_' + rowXNumber).value let valueX = document.getElementById(column + '_' + rowXNumber).value
let y = rows[i + 1] let y = rows[i + 1]
let rowYId = y.id let rowYId = y.id
let rowYNumber = rowYId.charAt(rowYId.length -1) let rowYNumber = rowYId.match(/\d+/)
let valueY = document.getElementById(column + '_' + rowYNumber).value let valueY = document.getElementById(column + '_' + rowYNumber).value
let currentSortOrder = document.getElementById(column + '_sort') let currentSortOrder = document.getElementById(column + '_sort')

View File

@ -35,7 +35,7 @@ class Router
/* /*
* This method takes a route like /admin/users/{user} and creates a regex to match on call * This method takes a route like /admin/users/{user} and creates a regex to match on call
* More complex routes as /posts/{thread}/show/{page} are supported as well. * More complex routes like /posts/{thread}/show/{page} are supported as well.
*/ */
function addRoute(string $name, string $route, Closure $callback): void function addRoute(string $name, string $route, Closure $callback): void
{ {
@ -84,7 +84,7 @@ class Router
foreach ($this->dynamicRoutes as $route) { foreach ($this->dynamicRoutes as $route) {
// PHPStorm doesn't know that $parameters are always available, // PHPStorm doesn't know that $parameters are always available,
// (as it this are dynamic routes) so I init the array just to make PHPStorm happy. // (as these are dynamic routes) so I init the array just to make PHPStorm happy.
$parameters = []; $parameters = [];
if (preg_match(pattern: $route->getRegex(), subject: $requestUri, matches: $matches)) { if (preg_match(pattern: $route->getRegex(), subject: $requestUri, matches: $matches)) {
foreach ($route->getParameters() as $id => $parameter) { foreach ($route->getParameters() as $id => $parameter) {