当前位置: 首页>>代码示例>>PHP>>正文


PHP Y::flash方法代码示例

本文整理汇总了PHP中Y::flash方法的典型用法代码示例。如果您正苦于以下问题:PHP Y::flash方法的具体用法?PHP Y::flash怎么用?PHP Y::flash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Y的用法示例。


在下文中一共展示了Y::flash方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionRecovery

	/**
	 * Recovery password
	 */
	public function actionRecovery () {
		$form = new UserRecoveryForm;
		if (Y::userId()) {
    		$this->redirect(Y::module()->returnUrl);
			Y::end();
		}

		$email = isset($_GET['email']) ? $_GET['email'] : '';
		$activkey = isset($_GET['activkey']) ? $_GET['activkey'] : '';
		if ($email&&$activkey) {	//get new pass
			
			$find = User::model()->notsafe()->findByAttributes(array('email'=>$email));
    		if(isset($find)&&$find->activkey==$activkey) {
				$form2 = new UserChangePassword;
    			if(isset($_POST['UserChangePassword'])) {
					$form2->attributes=$_POST['UserChangePassword'];
					if($form2->validate()) {
						$find->password = UserModule::encrypting($form2->password);
						if ($find->status==0) {
							$find->status = 1;
						}
						$find->save();
						Y::flash('recoveryMessage',Users::t("New password is saved."));
						$this->redirect(Y::module()->recoveryUrl);
					}
				} 
				$this->render('changepassword',array('form'=>$form2));
    		} else {
    			Y::flash('recoveryMessage',Users::t("Incorrect recovery link."));
				$this->redirect(Y::module()->recoveryUrl);
    		}
    	} else {	//send email
	    	if(isset($_POST['UserRecoveryForm'])) {
	    		$form->attributes=$_POST['UserRecoveryForm'];
	    		
	    		if($form->validate()) {
	    			$user = User::model()->notsafe()->findbyPk($form->user_id);
	    			$user->activkey = Y::module()->encrypting(microtime().$user->password);	
	    			$user->save();
	    			$activation_url = 'http://' . $_SERVER['HTTP_HOST'].$this->siteUrl('user/recovery',array("activkey" => $user->activkey, "email" => urldecode($user->email)));
					
					$subject = Users::t("You have requested the password recovery site {site_name}",
	    					array(
	    						'{site_name}'=>Yii::app()->name,
	    					));
	    			$message = Users::t("You have requested the password recovery site {site_name}. To receive a new password, go to {activation_url}.",
	    					array(
	    						'{site_name}'=>Yii::app()->name,
	    						'{activation_url}'=>$activation_url,
	    					));
					
	    			UserModule::sendMail($user->email,$subject,$message);
	    			
					Y::flash('recoveryMessage',Users::t("Please check your email. An instructions was sent to your email address."));
	    			$this->refresh();
	    		}
	    	}
    		$this->render('recovery',array('form'=>$form));
    	}
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:63,代码来源:RecoveryController.php

示例2: 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)
		);
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:17,代码来源:RegistrationController.php

示例3: array

<?php 
	echo CHtml::tag('div', array('class'=>'admin-flash-msg'), Y::flash('deleteCategory'));
	echo CHtml::link('Создать категорию', Admin::url('categories/createNode'));
	$this->widget('ext.QTreeGridView.CQTreeGridView',array(
		'dataProvider'=>$dp,
		'cssFile'=>Yii::app()->baseUrl.'/css/grid/styles.css',
		'template'=>'{items}',
		'hideHeader'=>false,
		//'pager'=>array('cssFile'=>'/css/pager/pager-styles.css'),
		'ajaxUpdate' => true,
		'columns'=>array(
	    	array(
	            'name'=>'title',
	            'type'=>'raw',
	            'value'=>'$data->title'
	        ),
	        array(
	            'name'=>'alias',
	            'type'=>'raw',
	            'value'=>'$data->alias'
	        ),
	        array(
	            'name'=>'type',
	            'type'=>'raw',
	            'value'=>'$data->type'
	        ),
	        array(
	        	'class'=>'CheckBoxColumnAjax',
	            'headerText'=>'published',
	            'checked'=>'$data->published',
	        ),
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:31,代码来源:tree.php

示例4: if

<?php 
$this->pageTitle=Yii::app()->name . ' - '.Users::t("Login");
$this->breadcrumbs=array(
	Users::t("Login"),
);
?>

<h1><?php echo Users::t("Login"); ?></h1>

<?php if(Y::hasFlash('loginMessage')) { ?>
    <div class="success">
        <?php echo Y::flash('loginMessage'); ?>
    </div>
<?php } ?>
<!--
<p><?php echo Users::t("Please fill out the following form with your login credentials:"); ?></p>
-->
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	    'id'=>'login-form',
	    'enableAjaxValidation'=>true,
	    'enableClientValidation'=>false,
	    'focus'=>array($model,'username'),
		'action'=>$this->module->loginUrl)
	); ?>
	<?php echo CHtml::errorSummary($model); ?>
	
    <div class="row">
        <?php echo $form->label($model,'username'); ?>
        <?php echo $form->textField($model,'username') ?>
    </div>
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:31,代码来源:login.php

示例5: if

<?php $this->pageTitle=Yii::app()->name . ' - '.Users::t("Restore");
$this->breadcrumbs=array(
	Users::t("Login") => Users::url('login'),
	Users::t("Restore"),
);
?>

<h1><?php echo Users::t("Restore"); ?></h1>

<?php if(Y::hasFlash('recoveryMessage')): ?>
<div class="success">
<?php echo Y::flash('recoveryMessage'); ?>
</div>
<?php else: ?>

<div class="form">
<?php echo CHtml::beginForm(); ?>

	<?php echo CHtml::errorSummary($form); ?>
	
	<div class="row">
		<?php echo CHtml::activeLabel($form,'login_or_email'); ?>
		<?php echo CHtml::activeTextField($form,'login_or_email') ?>
		<p class="hint"><?php echo Users::t("Please enter your login or email addres."); ?></p>
	</div>
	
	<div class="row submit">
		<?php echo CHtml::submitButton(Users::t("Restore")); ?>
	</div>

<?php echo CHtml::endForm(); ?>
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:31,代码来源:recovery.php

示例6: if

<?php $this->pageTitle=Yii::app()->name . ' - '.Users::t("Profile");
$this->breadcrumbs=array(
	Users::t("Profile")=>Users::url('cabinet'),
	Users::t("Edit"),
);
?>
<h2><?php echo Users::t('Edit profile'); ?></h2>
<?php if(Y::isGuest()) {$this->widget('GuestMenu');}
	  else {$this->widget('UserMenu');}
?>

<?php if(Y::hasFlash('profileMessage')): ?>
<div class="success">
<?php echo Y::flash('profileMessage'); ?>
</div>
<?php endif; ?>
<div class="form">
<?php $form=$this->beginWidget('UActiveForm', array(
	'id'=>'profile-form',
	'enableAjaxValidation'=>true,
	'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>

	<?php echo $form->errorSummary(array($model,$profile)); ?>

	<?php echo $this->renderPartial('_form', array('profile'=>$profile, 'form'=>$form))?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'username'); ?>
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:31,代码来源:edit.php

示例7: actionMoveData

	public function actionMoveData($action, $from, $to)
	{
		$fromCat = Category::model()->findByPk($from);
		$toCat = Category::model()->findByPk($to);
		
		if ($fromCat == null || $toCat == null)
			throw new CException("Не передан параметр fromCat или toCat в ".__CLASS__."::".__FUNCTION__);
	
		if ($fromCat->type != $toCat->type)
			throw new CException("Типы категорий не совпадают, копирование не может быть произведено.");
	
		if ($fromCat->moveAndDelete($action, $toCat))
			$msg = "Категория удалена успешно";
		else
			$msg = "Произошел сбой при удалении категории, попробуйте еще раз";
			
		Y::flash('deleteCategory', $msg);
		$this->redirect(Admin::url('categories/admin')); 		
	} 	
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:19,代码来源:CategoriesController.php

示例8: if

<?php $this->pageTitle=Yii::app()->name . ' - '.Users::t("Registration");
$this->breadcrumbs=array(
	Users::t("Registration"),
);
?>

<h1><?php echo Users::t("Registration"); ?></h1>
<?php if(Y::hasFlash('registration')): ?>
<div class="success">
<?php echo Y::flash('registration'); ?>
</div>
<?php else: ?>

<div class="form">
<?php $form=$this->beginWidget('UActiveForm', array(
	'id'=>'registration-form',
	'enableAjaxValidation'=>true,
	'disableAjaxValidationAttributes'=>array('RegistrationForm_verifyCode'),
	'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note"><?php echo Users::t('Fields with <span class="required">*</span> are required.'); ?></p>
	
	<?php echo $form->errorSummary(array($model,$profile)); ?>
	
	<div class="row">
	<?php echo $form->labelEx($model,'username'); ?>
	<?php echo $form->textField($model,'username'); ?>
	<?php echo $form->error($model,'username'); ?>
	</div>
	
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:30,代码来源:registration.php

示例9: 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>
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:31,代码来源:close.php


注:本文中的Y::flash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。