Answers for "grepper add existing answer"

0

grepper add code answer

variable in cakephp3 counting summming up

$payment_tbl = TableRegistry:: getTableLocator()->get(“MembershipPayment”);

$payment = $payment_tbl->find();
$payment->select( ['totalpmnt' => $payment->func()->sum('yoursumfield here') ]);

$this->set('payment',$payment->totalpmnt);
then in view
echo $payment;
should contain the sum.

or, if you do
$this->set('payment', $payment);
you need to do in your view:
echo $payment->totalpmnt;
or
<?= $payment->totalpmnt ?>
Posted by: Guest on June-28-2021

Browse Popular Code Answers by Language