frontend/modules/api/controllers/OrdersController.php
//custom action para saber o total de registos.
custom action para saber o total de registos.
custom action para saber o total de registos .
public function actionTotal()
   {
      $ordersModel = new $this->modelClass;
      $recs = $ordersModel::find()->all();
      return ['total' => count($recs)];
   }
public function actionTotal ( ) { $ ordersModel = new $ this -> modelClass ; $ recs = $ ordersModel :: find ( ) -> all ( ) ; return [ 'total' => count ( $ recs ) ] ; }
custom action para saber o total de registos.
custom action para saber o total de registos .