本文整理汇总了PHP中LBApplication::setCurrentlySelectedSubscription方法的典型用法代码示例。如果您正苦于以下问题:PHP LBApplication::setCurrentlySelectedSubscription方法的具体用法?PHP LBApplication::setCurrentlySelectedSubscription怎么用?PHP LBApplication::setCurrentlySelectedSubscription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LBApplication
的用法示例。
在下文中一共展示了LBApplication::setCurrentlySelectedSubscription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSubscription
/**
* Switch subscription
*
* @param unknown $id
*/
public function actionSubscription($id)
{
LBApplication::setCurrentlySelectedSubscription($id);
$this->redirect(Yii::app()->baseUrl . "/" . $id . "/lbInvoice/dashboard");
}
示例2: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new AccountSubscription();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['AccountSubscription'])) {
// $model->attributes=$_POST['AccountSubscription'];
// if($model->save())
// $this->redirect(array('view','id'=>$model->account_subscription_id));
// if (isset($_GET['package_id']))
// {
$package_id = 4;
// check if this user is already subscribe to this package
// if (AccountSubscription::model()->isAlreadySubscribedToPackage($package_id))
// {
// $this->redirect(array('accountTeamMember/admin'));
// }
// add subscription
$accountSubscription = new AccountSubscription();
$accountSubscription->account_id = Yii::app()->user->id;
$accountSubscription->account_subscription_package_id = $package_id;
$accountSubscription->account_subscription_start_date = date('Y-m-d H:i:s');
$accountSubscription->account_subscription_status_id = ACCOUNT_SUBSCRIPTION_STATUS_ACTIVE;
$accountSubscription->subscription_name = $_POST['AccountSubscription']['subscription_name'];
if ($accountSubscription->save()) {
LBApplication::setCurrentlySelectedSubscription($accountSubscription->account_subscription_id);
}
$this->redirect(array('accountTeamMember/admin'));
// }
// // no package id, go to home
// $this->redirect(array('project/index'));
}
$this->render('create', array('model' => $model));
}