php - Symfony 1.4 - How to recover the result of a count request in template? -
i have problem.
this request in model :
public function nbdomainesparurl($clientid) { $q = doctrine_query::create() ->from('domaine d') ->select('count(*)') ->where('d.client_id = ?', $clientid) ->leftjoin('d.client c') ->leftjoin('d.compteregistar') ->groupby('d.url') ; return $q; } public function executegetdomainesparurl($clientid) { return $this->getdomainesparurl($clientid)->execute(); }
i execute in action.class.php :
$this->nb_domaines = doctrine::gettable('domaine')->executegetdomainesparurl($request->getparameter('id'));
the result of request : 19,1,1
but don't know how recover result in template.
you have alias count in order retrieve easily.
$q = doctrine_query::create() ->from('domaine d') ->select('count(*) nb') [...]
and else in result
if use ->getresult()
:
$count = $result[0]['nb'];
with $row = $query->execute()
$count = $row['nb'];
Comments
Post a Comment