27 lines
593 B
PHP
27 lines
593 B
PHP
<?php
|
|
|
|
use yii\base\Controller;
|
|
|
|
class SiteController extends Controller {
|
|
function actionIndex() {
|
|
echo $title;
|
|
|
|
$id = $_GET['id'];
|
|
$user = Yii::$app->db->createCommand("SELECT * FROM user WHERE id = $id")->queryOne();
|
|
|
|
echo $user['name'];
|
|
|
|
echo '<form method="post"><input name="test"></form>';
|
|
|
|
$model = new \app\models\User();
|
|
$model->name = $_POST['name'];
|
|
$model->save();
|
|
|
|
require_once('/var/www/html/config.php');
|
|
|
|
throw new Exception('Error!');
|
|
|
|
return true;
|
|
}
|
|
}
|