- ⌂ io_comand_mvc
- Classes
cMVC Models
The cMVC Framework does not provide a model class like many other frameworks. Instead, models are app-specific classes that extend one of the COMAND Models, like \io_comand_repo\models\Content. Your models should extend the COMAND Model that most closely corresponds to the content type extended by the content type each model corresponds to.
Model Example
// File: packages/com_example_www/models/Contact.php
namespace com_example_www;
use io_comand_email\mail;
class Contact extends \io_comand_repo\models\Content {
/**
* Send an email to the contact.
*/
public function email($subject, $message){
return mail::mail($this->Email, $subject, $message);
}
/**
* Override default object description.
*/
public function method__description() {
return $this->Email;
}
}