Posts

Showing posts with the label yii2

how to print 1st reminder, 2nd reminder in gridview yii2 from model?

Image
Clash Royale CLAN TAG #URR8PPP how to print 1st reminder, 2nd reminder in gridview yii2 from model? Here is my view page view.php view.php <div class="dataTables_wrapper form-inline dt-bootstrap"> <?= GridView::widget([ 'dataProvider' => $dataProvider1, 'columns' => [ ['class' => 'yiigridSerialColumn'], [ 'label' =>'Date', 'value' => 'date', ], [ 'label' =>'Reminder', 'value' => function($model){ return Yii::$app->session->get('').' '.$model['type'].' '.'reminder'; } ], [ 'label' =>'To', 'value' => 'recipients', ...

Yii2 machour NotificationsWidget class not found

Image
Clash Royale CLAN TAG #URR8PPP Yii2 machour NotificationsWidget class not found We are trying to run "machour" notification widget in Yii2-Advanced template. We could successfully install the extension through composer. We are getting the following class error: Class 'NotificationsWidget' not found. The above problem is still existing Yii2 notification widget class not found. We are calling following code in layouts folder: use commonmodelsNotification; <?php NotificationsWidget::widget([ 'theme' => NotificationsWidget::THEME_GROWL, 'clientOptions' => [ 'location' => 'br', ], 'counters' => [ '.notifications-header-count', '.notifications-icon-count' ], 'markAllSeenSelector' => '#notification-seen-all', 'listSelector' => '#notifications', ]); ?> And this is...

yii2 mailer mail not sent

Image
Clash Royale CLAN TAG #URR8PPP yii2 mailer mail not sent There are absolutely two identical methods for sending mail (registration of a new user, sending a letter to activate the user ). One method is implemented in the console, and it works: public function actionSendMessage() { $user = new User(); $this->readValue($user, 'username'); $this->readValue($user, 'login'); $this->readValue($user, 'email'); $user->hash_password = Yii::$app->getSecurity()->generatePasswordHash($this->prompt('password')); $this->readValue($user, 'phone'); $this->readValue($user, 'address');; $user->state = User::STATUS_WAIT; $user->generateAuthKey(); $user->generateEmailConfirmToken(); if ($user->save()) { Yii::$app->mailer->compose('@app/mail/emailConfirm', ['user' => $user]) -...

Yii2 multiple table in gridview

Image
Yii2 multiple table in gridview I have 2 tables with strategy and risk_colors . strategy risk_colors I generated Model and CRUD with GII and modified it just a little to get risk_value column in my GridView widget. risk_value Here is my Strategy.php Strategy.php <?php namespace backendmodels; use Yii; use yiidbActiveRecord; use yiihelpersUrl; use yiihelpersHtml; use yiihelpersArrayHelper; use yiidbExpression; /** * This is the model class for table "strategy". * * @property int $id * @property string $strategy_title * @property string $strategy_description * @property string $strategy_current_money * @property int $risk_colors_id * * @property SelectedStrategies $selectedStrategies * @property RiskColors $riskColors */ class Strategy extends yiidbActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return 'strategy'; } /** * {@inheritdoc} */ public function rules() { ...