當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Student::className方法代碼示例

本文整理匯總了PHP中app\models\Student::className方法的典型用法代碼示例。如果您正苦於以下問題:PHP Student::className方法的具體用法?PHP Student::className怎麽用?PHP Student::className使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Student的用法示例。


在下文中一共展示了Student::className方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionToggle

 /**
  * Toggles a binary field from the summary grid
  * @param type $id
  * @param type $attribute
  * @return mixed ajax response
  * @throws ForbiddenHttpException
  */
 public function actionToggle($id, $attribute)
 {
     $accessParams = ['student' => Student::findOne($id)];
     if (Yii::$app->user->can('updateStudent', $accessParams)) {
         $action = new ToggleAction('toggle', $this, ['modelClass' => Student::className()]);
         return $action->run($id, $attribute);
     } else {
         throw new ForbiddenHttpException(Yii::t('app', 'You are not authorized to perform this action.'));
     }
 }
開發者ID:NewPaltzKarateAcademy,項目名稱:KIMS,代碼行數:17,代碼來源:StudentController.php

示例2: getStudents

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudents()
 {
     return $this->hasMany(Student::className(), ['school_id' => 'id']);
 }
開發者ID:NewPaltzKarateAcademy,項目名稱:KIMS,代碼行數:7,代碼來源:School.php

示例3: getStudent

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudent()
 {
     return $this->hasOne(Student::className(), ['id' => 'student_id']);
 }
開發者ID:NewPaltzKarateAcademy,項目名稱:KIMS,代碼行數:7,代碼來源:StudentPhone.php

示例4: getStudents

 public function getStudents()
 {
     return $this->hasMany(Student::className(), ['id' => 'student_id'])->viaTable('teacher_student', ['teacher_id' => 'id']);
 }
開發者ID:kmarenov,項目名稱:yii2-app-test,代碼行數:4,代碼來源:Teacher.php

示例5: getStudents

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudents()
 {
     return $this->hasMany(Student::className(), ['id' => 'student_id'])->via('assignedRanks');
 }
開發者ID:NewPaltzKarateAcademy,項目名稱:KIMS,代碼行數:7,代碼來源:Rank.php

示例6: getUserStudent

 public function getUserStudent()
 {
     return $this->hasOne(Student::className(), ['st_id' => 'usr_type_id']);
 }
開發者ID:AtaBashir,項目名稱:ams,代碼行數:4,代碼來源:UserStudent.php

示例7: rules

 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['student_id', 'teacher_id'], 'required'], [['student_id', 'teacher_id'], 'integer'], ['student_id', 'exist', 'targetClass' => Student::className(), 'targetAttribute' => 'id', 'message' => 'Ученик с таким id не найден'], ['teacher_id', 'exist', 'targetClass' => Teacher::className(), 'targetAttribute' => 'id', 'message' => 'Учитель с таким id не найден']];
 }
開發者ID:Olga--Trushina,項目名稱:teachers,代碼行數:7,代碼來源:StudentTeacher.php


注:本文中的app\models\Student::className方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。