Commit 3854e047 by dianc

Merge remote-tracking branch 'origin/development' into development

parents 538e87c8 59e20f91
...@@ -13,8 +13,8 @@ class m160907_100248_website extends Migration ...@@ -13,8 +13,8 @@ class m160907_100248_website extends Migration
$this->createTable('{{%website}}', [ $this->createTable('{{%website}}', [
'id' => $this->primaryKey(), 'id' => $this->primaryKey(),
'business_id' => $this->integer(), 'business_id' => $this->integer()->notNull(),
'theme_id' => $this->integer(), 'theme_id' => $this->integer()->notNull(),
'domain_name' => $this->string(255)->notNull(), 'domain_name' => $this->string(255)->notNull(),
'expiry_date' => $this->string(11)->notNull(), 'expiry_date' => $this->string(11)->notNull(),
'status' => $this->smallInteger(6), 'status' => $this->smallInteger(6),
......
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
"bower-asset/jquery-slimscroll": "^1.3", "bower-asset/jquery-slimscroll": "^1.3",
"bower-asset/flot": "^0.8", "bower-asset/flot": "^0.8",
"petrabarus/yii2-googleplacesautocomplete": "dev-master", "petrabarus/yii2-googleplacesautocomplete": "dev-master",
"symfony/process": "^3.0" "symfony/process": "^3.0",
"yiisoft/yii2-httpclient": "*"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-debug": "^2.0.0", "yiisoft/yii2-debug": "^2.0.0",
......
...@@ -4,6 +4,7 @@ namespace frontend\controllers; ...@@ -4,6 +4,7 @@ namespace frontend\controllers;
use Yii; use Yii;
use frontend\models\ContactForm; use frontend\models\ContactForm;
use yii\web\Controller; use yii\web\Controller;
use yii\httpclient\Client;
/** /**
* Site controller * Site controller
...@@ -23,16 +24,28 @@ class SiteController extends Controller ...@@ -23,16 +24,28 @@ class SiteController extends Controller
'class' => 'yii\captcha\CaptchaAction', 'class' => 'yii\captcha\CaptchaAction',
'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null
], ],
'set-locale'=>[ 'set-locale' => [
'class'=>'common\actions\SetLocaleAction', 'class' => 'common\actions\SetLocaleAction',
'locales'=>array_keys(Yii::$app->params['availableLocales']) 'locales' => array_keys(Yii::$app->params['availableLocales'])
] ]
]; ];
} }
public function actionIndex() public function actionIndex()
{ {
return $this->render('index'); $client = new Client();
$response = $client->createRequest()
->setMethod('get')
->setUrl('http://libromi.yii/api/v1/business/view')
->setData(['id' => '2'])
->send();
// echo '<pre>';
// var_dump($response);
// echo '</pre>';
// exit;
$data = $response->isOk ? $response->data['name'] : ['dfsdfsd'];
return $this->render('index', ['data' => $data]);
} }
public function actionContact() public function actionContact()
...@@ -41,14 +54,16 @@ class SiteController extends Controller ...@@ -41,14 +54,16 @@ class SiteController extends Controller
if ($model->load(Yii::$app->request->post())) { if ($model->load(Yii::$app->request->post())) {
if ($model->contact(Yii::$app->params['adminEmail'])) { if ($model->contact(Yii::$app->params['adminEmail'])) {
Yii::$app->getSession()->setFlash('alert', [ Yii::$app->getSession()->setFlash('alert', [
'body'=>Yii::t('frontend', 'Thank you for contacting us. We will respond to you as soon as possible.'), 'body' => Yii::t('frontend',
'options'=>['class'=>'alert-success'] 'Thank you for contacting us. We will respond to you as soon as possible.'),
'options' => ['class' => 'alert-success']
]); ]);
return $this->refresh(); return $this->refresh();
} else { } else {
Yii::$app->getSession()->setFlash('alert', [ Yii::$app->getSession()->setFlash('alert', [
'body'=>\Yii::t('frontend', 'There was an error sending email.'), 'body' => \Yii::t('frontend', 'There was an error sending email.'),
'options'=>['class'=>'alert-danger'] 'options' => ['class' => 'alert-danger']
]); ]);
} }
} }
......
...@@ -3,62 +3,7 @@ ...@@ -3,62 +3,7 @@
$this->title = Yii::$app->name; $this->title = Yii::$app->name;
?> ?>
<div class="site-index"> <div class="site-index">
<?php
<?php echo \common\widgets\DbCarousel::widget([ print_r($data);
'key'=>'index', ?>
'options' => [
'class' => 'slide', // enables slide effect
],
]) ?>
<div class="jumbotron">
<h1>Congratulations!</h1>
<p class="lead">You have successfully created your Yii-powered application.</p>
<?php echo common\widgets\DbMenu::widget([
'key'=>'frontend-index',
'options'=>[
'tag'=>'p'
]
]) ?>
</div>
<div class="body-content">
<div class="row">
<div class="col-lg-4">
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>
<p><a class="btn btn-default" href="http://www.yiiframework.com/doc/">Yii Documentation &raquo;</a></p>
</div>
<div class="col-lg-4">
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>
<p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p>
</div>
<div class="col-lg-4">
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>
<p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions &raquo;</a></p>
</div>
</div>
</div>
</div> </div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment