本文整理汇总了PHP中frontend\models\User::getFullname方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getFullname方法的具体用法?PHP User::getFullname怎么用?PHP User::getFullname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frontend\models\User
的用法示例。
在下文中一共展示了User::getFullname方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionNew
public function actionNew($type)
{
$model = new Razz();
$model->scenario = 'create';
if ($type == 'any') {
$model->type = $model::ANYONE;
}
if ($type == 'some') {
$model->type = $model::SOMEONE;
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
if ($model->type == 1 && !$model->fb_friend) {
$this->redirect(['/razz/vote-on-challenges', 't' => 'some']);
}
if ($model->fb_friend) {
$Razz = Yii::$app->request->post('Razz', null);
if ($Razz['fileName'] != "") {
$linkToImg = \common\helpers\Ziggeo::getPreview($Razz['fileName']);
} else {
$linkToImg = $model->preview;
}
$twitter = new \common\helpers\Twitter();
$userModel = new \frontend\models\User();
$userName = ucfirst($userModel->getFullname(Yii::$app->user->id));
$recipientNick = $model->screen_name;
$linkToRazzd = Url::base(true) . "/razz/respond/" . $model->id;
$text = "@{$recipientNick} You have been Razzd by {$userName}: '{$model->title}' {$linkToRazzd}";
$r = $twitter->tweet($text, ['image' => $linkToImg]);
if ($twitter->hasErrors()) {
// Error
} else {
if (isset($r['id'])) {
// Success
}
}
$this->redirect(['/razz/vote-on-challenges', 't' => 'some']);
/*
* Facebook
$client = Yii::$app->authClientCollection->getClient('facebook');
$host = 'http://' . $_SERVER['HTTP_HOST'];
$this->redirect('http://www.facebook.com/dialog/send?app_id=' . $client->clientId . '&to=' . $model->fb_friend . '&link=' . $host . '/razz/respond?hash=' . $model->hash . '&redirect_uri=' . $host . '/razz/vote-on-challenges?t=some');
*/
}
if ($model->type == 2) {
$this->redirect(['/razz/vote-on-challenges', 't' => 'any']);
}
} else {
//print_r($model->getErrors());
//exit();
}
return $this->render('new', ['model' => $model]);
}