本文整理汇总了PHP中Y::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Y::config方法的具体用法?PHP Y::config怎么用?PHP Y::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Y
的用法示例。
在下文中一共展示了Y::config方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->baseUrl = Y::config('baseUrl');
Yii::app()->language = isset($_GET['lang']) ? $_GET['lang'] : "ru";
parent::init();
}
示例2: __construct
public function __construct($config = [])
{
// 由于多态 此时 $this 是子类 Application
Y::$app = $this;
$this->errorHandler();
$this->init($config);
Y::config($this, $config);
}
示例3: actionClose
public function actionClose() {
$email = new Email;
$this->performAjaxValidation($email);
if(isset($_POST['Email'])) {
$email->attributes = $_POST['Email'];
$email->to = Y::config('email_to_registraiton');
$email->send();
Y::flash('success',Yii::t('interface', "email was sended"));
}
$this->render('/registration/close',
array('model' => $email)
);
}
示例4: array
<div>
<?php echo Yii::t('errors', 'registration close', array('{email}'=>Y::config('email_to_registraiton') ));?>
</div>
<div class="form">
<?php
if(Y::hasFlash('success')) {
echo CHtml::tag('div', array('class'=>'success'), Y::flash('success'));
}?>
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'send-mail',
'enableAjaxValidation'=>true
)); ?>
<?php echo CHtml::errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'subject'); ?>
<?php echo $form->textField($model,'subject') ?>
<?php echo $form->error($model,'subject'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'message'); ?>
<?php echo $form->textArea($model,'message') ?>
<?php echo $form->error($model,'message'); ?>
</div>
<div class="row submit">
<?php echo CHtml::submitButton(Yii::t('interface', "send mail")); ?>
</div>
示例5: sendMail
/**
* Send mail method
*/
public static function sendMail($email,$subject,$message) {
$model = new Email;
$model->email_name = self::t("Your registration");
$model->subject = $subject;
$model->message = $message;
$model->to = $email;
$model->from = Y::config('email_to_registraiton');
return $model->send();
}