示例#1
0
 public static function init()
 {
     if (!self::$MvcDb instanceof MvcDb) {
         if (MvcApplication::get()) {
             self::$MvcDb = new MvcDb(MvcApplication::get()->configuration['db']);
         } else {
             throw new \Exception('Cannot Retrieve MvcApplication instance.');
         }
     }
     return self::$MvcDb;
 }
示例#2
0
 public function composeBody($data)
 {
     $configuration = MvcApplication::get()->getConfiguration();
     $this->body = '<html><body>';
     $this->body .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
     $this->body .= "<tr style='background: #ff0000;'><td colspan='2'><strong>This email is for user verification. Please click the Account Activation Link below for activation of your account</strong> </td></tr>";
     $this->body .= "<tr style='background: #eee;'><td><strong>Full Name:</strong> </td><td>" . strip_tags($data['firstname'] . ' ' . $data['middlename'] . ' ' . $data['firstname']) . "</td></tr>";
     $this->body .= "<tr><td><strong>Email:</strong> </td><td>" . strip_tags($data['email']) . "</td></tr>";
     $this->body .= "<tr><td><strong>Password:</strong> </td><td>" . strip_tags($data['unhashed']) . "</td></tr>";
     $this->body .= "<tr><td><strong>Phone Number:</strong> </td><td>" . strip_tags($data['phonenumber']) . "</td></tr>";
     $this->body .= "<tr><td><strong>Link for Account Activation:</strong> </td><td>" . strip_tags($configuration['app']['path'] . '/registration/activation/') . base64_encode($data['email']) . "</td></tr>";
     $this->body .= "</table>";
     $this->body .= "</body></html>";
     return $this;
 }
示例#3
0
 public function getBaseUrl()
 {
     return MvcApplication::get() ? MvcApplication::get()->configuration['app']['path'] : '';
 }