本文整理汇总了PHP中AbstractObject::init方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractObject::init方法的具体用法?PHP AbstractObject::init怎么用?PHP AbstractObject::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractObject
的用法示例。
在下文中一共展示了AbstractObject::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
parent::init();
$m = $this->results = $this->add('Model');
$m->addField('name');
$m->addField('is_success')->type('boolean');
$m->addField('exception')->type('object');
$m->addField('time')->type('float');
$m->addField('memory')->type('int');
$m->addField('ticks')->type('int');
$m->addField('result')->type('object');
$m->addfield('debug')->type('text');
$a = array();
$m->setSource('Array', $a);
}
示例2: init
function init()
{
parent::init();
require_once 'lib/Swift/swift_init.php';
$email_settings = $this->api->current_website;
switch ($email_settings['email_transport']) {
case 'SmtpTransport':
$transport = Swift_SmtpTransport::newInstance($email_settings['email_host'], $email_settings['email_port'], $email_settings['encryption'] != 'none' ? $email_settings['encryption'] : null);
$transport->setUsername($email_settings['email_username']);
$transport->setPassword($email_settings['email_password']);
break;
case 'SendmailTransport':
$transport = Swift_SendmailTransport::newInstance();
break;
case 'MailTransport':
$transport = Swift_MailTransport::newInstance();
break;
default:
# code...
break;
}
$this->mailer = Swift_Mailer::newInstance($transport);
}