提交 bb8f4992 编写于 作者: R root

catalog product search

上级 c5598ddb
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
return [
'catalogsearch' => [
'class' => '\fecshop\app\appfront\modules\Catalogsearch\Module',
'params'=> [
],
],
];
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Catalogsearch;
use Yii;
use fecshop\app\appfront\modules\AppfrontModule;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Module extends AppfrontModule
{
public $blockNamespace;
public function init()
{
# 以下代码必须指定
$nameSpace = __NAMESPACE__;
# web controller
if (Yii::$app instanceof \yii\web\Application) {
$this->controllerNamespace = $nameSpace . '\\controllers';
$this->blockNamespace = $nameSpace . '\\block';
# console controller
//} elseif (Yii::$app instanceof \yii\console\Application) {
// $this->controllerNamespace = $nameSpace . '\\console\\controllers';
// $this->blockNamespace = $nameSpace . '\\console\\block';
}
//$this->_currentDir = __DIR__ ;
//$this->_currentNameSpace = __NAMESPACE__;
# 指定默认的man文件
//$this->layout = "home.php";
Yii::$service->page->theme->layoutFile = 'main.php';
parent::init();
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Catalogsearch\block\index;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
return [];
}
}
\ No newline at end of file
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Catalogsearch\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class IndexController extends AppfrontController
{
public function init(){
parent::init();
}
# վϢ
public function actionIndex()
{
//echo 1;exit;
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
?>
<div class="main container two-columns-left">
<div class="col-main">
</div>
<div class="col-left ">
</div>
<div class="clear"></div>
</div>
\ No newline at end of file
......@@ -87,17 +87,17 @@
<div class="top_main_inner pr">
<div class="top_header clearfix">
<div class="topSeachForm">
<form method="post" name="searchFrom" class="js_topSeachForm">
<form method="get" name="searchFrom" class="js_topSeachForm" action="<?= Yii::$service->url->getUrl('catalogsearch/index'); ?>">
<div class="top_seachBox">
<div class="searchInput fl">
<input type="text" autocomplete="off" value="" maxlength="150" placeholder="Products keyword" class="searchArea js_k2 ac_input" name="k1">
<input type="text" value="<?= Yii::$app->request->get('q'); ?>" maxlength="150" placeholder="Products keyword" class="searchArea js_k2 ac_input" name="q">
</div>
<button class="fl js_topSearch seachBtn" type="submit"><span class="t_hidden">search</span></button>
<input type="hidden" class="category" value="0" name="category">
</div><!--end .top_seachBox-->
<!-- <input type="hidden" class="category" value="0" name="category"> -->
</div><!--end .top_seachBox-->
</form>
</div>
<div class="logo"><a titel="fecshop logo" href="<?= $homeUrl ?>" style="">
<img src="<?= Yii::$service->image->getImgUrl('custom/logo.png','appfront'); ?>" />
</a></div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册