So, while normally I just code JSON feeds for some of the AJAX applications on my site manually using Couch tags, I'm having a bit of an issue where using the built-in json_encode feature from PHP would make my life better.
Problem - I keep getting an error that the closing PHP tag doesn't exist. Here's the code:
Problem - I keep getting an error that the closing PHP tag doesn't exist. Here's the code:
- Code: Select all
<cms:set jsonResult="<cms:php>
$jsonFeed = $array();
<cms:pages>
array_push($jsonFeed, ["progID"=>k_page_id,"presenterName"=>presenter_name,"presenterAddress"=>presenter_address,
"presenterPhone"=>presenter_phone,"presenterEmail"=>presenter_email,
"contactPreference"=>contact_preference,"progName"=>k_page_title,"progBranch"=>desired_location,
"targetAudience"=>target_audience,"feeNeeded"=>fee_radio,"feeAmount"=>fee_amount,
"feeNegotiable"=>fee_negotiable,"pastPresentations"=>past_presentation,
"pastLocations"=>past_when_and_where,
"profReferences"=>professional_references,"progDesc"=>program_description]);
</cms:pages>
echo(json_encode($jsonFeed));
</cms:php>" />
<cms:show jsonResult />