Skip to content

Instantly share code, notes, and snippets.

View dreamzspl's full-sized avatar

Sng Poh Liang dreamzspl

  • Singapore
  • 06:32 (UTC +08:00)
View GitHub Profile
@nkb-bd
nkb-bd / ff-numeric-addon-bttns.php
Created October 4, 2023 17:38
Fluent Forms : Number field with buttons
/*
* Fluent Form : Creating a Number field with + / - Button embeded with the input field
* Take a Numeric Field then add element class 'incremental-input', thats it
*/
add_filter('fluentform/rendering_field_data_input_number', function ($data) {
if ($data['attributes']['class'] == 'incremental-input') {
$data['settings']['prefix_label'] = '<button class="ff-btn-step-plus">+</button>';
$data['settings']['suffix_label'] = '<button class="ff-btn-step-minus">-</button>';
}
return $data;
@zcaceres
zcaceres / Nested-Routers-Express.md
Last active August 14, 2025 13:53
Child Routers in Express

Nested Routers in Express.js

Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params when you had a long URI with multiple parameters and nested routes.

Let's say you're building routes for a website www.music.com. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.

At our application level, we could first have a Router to handle any requests to our albums.

const express = require('express');