Hey Guys,
first of all I want to thank you for that great component. Its just unbelievable what you can do with it. It makes many other components simply redundant.
I'm about to set up a website for a social project. Right now, CF its still free licence, but as soon as I see that everything I plan can be done with CF, I will buy a premium licence of course.
Problem:
So, I set up some forms and listing forms. The only thing I missed was the router.php, or some other way to handle handsome urls. So I created one router.php in the component folder (added of course also to .xml).
The Router.php looks like that
So, working so far --> URL looks like that
http://*mysite*/*lang*/*itemname*/*formname*/*token*
for example
http://www.thisisagreatsite.com/en/menu_one/view_my_form/8duswsa9hdw39jcds233w
But I'm struggling with the token. Whatever I put in the ParseRoute $vars['token'] its not parsing anything. Does maybe someone have a hint for me?
Thank you!
first of all I want to thank you for that great component. Its just unbelievable what you can do with it. It makes many other components simply redundant.
I'm about to set up a website for a social project. Right now, CF its still free licence, but as soon as I see that everything I plan can be done with CF, I will buy a premium licence of course.
Problem:
So, I set up some forms and listing forms. The only thing I missed was the router.php, or some other way to handle handsome urls. So I created one router.php in the component folder (added of course also to .xml).
The Router.php looks like that
function chronoformsBuildRoute( &$query )
{
$segments = array();
if(isset($query['chronoform']))
{
$segments[] = $query['chronoform'];
unset( $query['chronoform'] );
}
if(isset($query['token']))
{
$segments[] = $query['token'];
unset( $query['token'] );
}
return $segments;
}
function chronoformsParseRoute( $segments )
{
$vars = array();
switch($segments[0])
{
case 'view_my_form':
$vars['chronoform'] = 'view_my_form';
$vars['token'] = '';
break;
case 'view_my_second_form':
$vars['chronoform'] = 'view_my_second_form';
break;
case 'view_my_third_form':
$vars['chronoform'] = 'view_my_third_form';
break;
}
return $vars;
}
So, working so far --> URL looks like that
http://*mysite*/*lang*/*itemname*/*formname*/*token*
for example
http://www.thisisagreatsite.com/en/menu_one/view_my_form/8duswsa9hdw39jcds233w
But I'm struggling with the token. Whatever I put in the ParseRoute $vars['token'] its not parsing anything. Does maybe someone have a hint for me?
Thank you!