When text is set after a placeholder the last character is removed.
$router->add('/test/:int/test', [
'action' => 'index',
'controller' => 'index',
'id' => 1
])
->setName('test');
{{ link_to(['for': 'test', 'id': '123'], 'test') }}
extected:
<a href="/test/123/test">test</a>
actual:
<a href="/test/123/tes">test</a>
Define your route as: $router->add('/test/:int/test/'
(with a trailing slash)
this is expected behavior ?
Looks weird for me. I'll try to sort out ASAP.
@be4i The /:int placeholder is alias for /([0-9]+). As workaround try group :int. I'll try to deal with this
PHP
$router = new Phalcon\Mvc\Router();
$router->add('/test/(:int)/test', [
'action' => 'index',
'controller' => 'index',
'id' => 1
])
->setName('test');
Volt
{{ link_to(['for': 'test', 'id': '123'], 'test') }}
HTML
<a href="/test/123/test">test</a>
PHP
$router = new Phalcon\Mvc\Router();
$router->add('/test/{id:[0-9]+}/test', [
'action' => 'index',
'controller' => 'index',
])
->setName('test');
Volt
{{ link_to(['for': 'test', 'id': '123'], 'test') }}
HTML
<a href="/test/123/test">test</a>
PHP
$router = new Phalcon\Mvc\Router();
$router->add('/test/([0-9]+)/test', [
'action' => 'index',
'controller' => 'index',
'id' => 1,
])
->setName('test');
Volt
{{ link_to(['for': 'test', 'id': '123'], 'test') }}
HTML
<a href="/test/123/test">test</a>
okay, thank you
Most helpful comment
@be4i The
/:intplaceholder is alias for/([0-9]+). As workaround try group:int. I'll try to deal with thisPHP
Volt
HTML
PHP
Volt
HTML
PHP
Volt
HTML