本文整理汇总了PHP中Newsletter::make方法的典型用法代码示例。如果您正苦于以下问题:PHP Newsletter::make方法的具体用法?PHP Newsletter::make怎么用?PHP Newsletter::make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Newsletter
的用法示例。
在下文中一共展示了Newsletter::make方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCheck
public function actionCheck($key)
{
$executionTime = KeyValue::model()->findByPk('newsletter_execution_time');
$frequency = KeyValue::model()->findByPk('newsletter_frequency');
$newsletter = new Newsletter();
if (time() >= strtotime($executionTime->value) + $frequency->value && $frequency->value != '1' && $newsletter->make() !== false) {
$this->render('check', array('send' => 'true'));
} else {
$this->render('check', array('send' => 'false'));
}
Yii::app()->end();
}
示例2: actionAdmin
public function actionAdmin()
{
$model = new AdminForm();
$frequency = KeyValue::model()->findByPk('newsletter_frequency');
$model->frequency = abs($frequency->value);
if (isset($_POST['AdminForm'])) {
$model->attributes = $_POST['AdminForm'];
if ($model->validate()) {
if (isset($_POST['yt1']) || $frequency->value < 0) {
$frequency->value = -$model->frequency;
} else {
$frequency->value = $model->frequency;
}
$frequency->save();
$this->redirect('admin');
}
}
$newsletter = new Newsletter();
$this->render('admin', array('newsletter' => $newsletter->make(), 'model' => $model));
}