Skip to content

Instantly share code, notes, and snippets.

@markphi2013
Created September 13, 2013 11:30
Show Gist options
  • Save markphi2013/6549510 to your computer and use it in GitHub Desktop.
Save markphi2013/6549510 to your computer and use it in GitHub Desktop.
programstats ajax
<?php
echo $this->Js->object();
?>
the out put is "[ ]"
public function getProgramStats()
{
if(isset($this->params['url']['program'])){
$programUrl = $this->Program->find('first', array('conditions' => array('url'=> $this->params['url']['program'])));
$programStats = $this->Stats->getProgramStats($programUrl['Program']['database']);
return $programStats;
}
}
here url will alway be empty array cause we are on the program index and no program is selected yet .
$programUrl['Program']['database'] returns m4rh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment