1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\controllers;
- use Yii;
- use yii\filters\AccessControl;
- use yii\web\Controller;
- use yii\web\Response;
- use yii\filters\VerbFilter;
- use app\models\LoginForm;
- use app\models\ContactForm;
- use app\models\Accounts;
- class ApiController extends Controller
- {
-
-
- public function actionIndex()
- {
- $accountsModel = Accounts::find()
- ->where(['id' => 1])
- ->one();
- foreach($accountsModel as $account){
-
- //var_dump($account->name);
- }
- var_dump($accountsModel->name);
-
- die();
-
- return $this->render('apitest');
- }
-
- }
|