1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace frontend\controllers;
- use Yii;
- use yii\base\InvalidParamException;
- use yii\web\BadRequestHttpException;
- use yii\web\Controller;
- use yii\filters\VerbFilter;
- use yii\filters\AccessControl;
- use common\models\LoginForm;
- use frontend\models\PasswordResetRequestForm;
- use frontend\models\ResetPasswordForm;
- use frontend\models\SignupForm;
- use frontend\models\ContactForm;
- /**
- * Site controller
- */
- class ApiController extends Controller
- {
- public function behaviors()
- {
- return [
- 'verbs' => [
- 'class' => VerbFilter::className(),
- 'actions' => [
- 'api' => ['get', 'post'],
- 'index' => ['get', 'post'],
- ],
- ],
- ];
- }
- public function actionApi()
- {
- return 'hello world';
- }
- /**
- * Displays contact json交互.
- *
- * @return mixed
- */
- public function actionJson()
- {
- $post=Yii::$app->request->get();
- var_dump($post);
- }
- }
|