I've tried doing the tutorial done
here.
I am also aware this has been made in a transport package (which is the one I have installed at the moment and where I am having an issue with), I am also very aware that some values/variables are slightly named different to the ones in the transport package.
-
Now onto my little issue.
The tutorial says to make a snippet,
I make the snippet with the following code:
<?php
//Get the System Setting (needed only once per Resource)
$argsName = !empty($argsName) ? $argsName : $modx->getOption('url_params_name', null, 'urlParams');
// Get an ordered Parameter
if (!empty($_REQUEST[$argsname][0]))
$value = $_REQUEST[$argsname][0]; // <-- Replace # with the segment index.
else
$value = 'Nothing sent';
$output = '<p>' . $value . '</p>';
return $output;
I do the following changes so it works with the transport package version:<?php
//Get the System Setting (needed only once per Resource)
$argsName = !empty($argsName) ? $argsName : $modx->getOption('key_params', null, 'url_params');
// Get an ordered Parameter
if (!empty($_REQUEST[$argsName][0]))
$value = $_REQUEST[$argsName][0]; // <-- Replace # with the segment index.
else
$value = 'Nothing sent';
$output = '<p>' . $value . '</p>';
return $output;
I do the part with making a resource, placing the newly made snippet call within the newly created resource. I view the page and if displays the "Nothing Sent" message. I proceed to type my '/ajax/' and 'whatever' next to it so my URL bar looks like http://localhost/abcd/testpage/ajax/whatever . I hit enter waiting to be greeted by the very same "Viola!" I see in the tutorial, instead I am greeted to a 404 error in I.E. and in Chrome it redirects me to the home page of the modx installation.
Help. Please. I was not greeted by "Viola!" (referring to the value being displayed on my browser as 'whatever'

) and severely disappointed by hours upon hours of getting this to work.