PHP Services
Additional functionality
Additional functionality
Service is a class that provides additional functionality. Services can be loaded using get() method.
$userName = $this->get('user')->getName();
Get all pages from Bill -table where 'Status=Unpaid' and show total sum:
$unpaidTotal = $this->get('pages', 'bill')->addWhere('status','Unpaid')->calculate('sum');
Get mail -resource and send an email
$this->get('mail', Array(
'from' => $Order->employee->email,
'to' => $Order->customer->email,
'subject' => 'Offer',
'body' => Have you got our offer?'
))->send();