本文整理匯總了PHP中Products::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Products::search方法的具體用法?PHP Products::search怎麽用?PHP Products::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Products
的用法示例。
在下文中一共展示了Products::search方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: indexAction
public function indexAction()
{
$ns = new Zend_Session_Namespace();
$search = $this->getRequest()->getParam('q');
if (!empty($search)) {
$this->view->search = htmlspecialchars($search);
$this->view->results = Products::search($search, $ns->langid, false);
} else {
$this->_redirect('/');
}
}
示例2: Products
<?php
$model = new Products();
$this->widget('zii.widgets.grid.CGridView', array('id' => 'products-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('title', 'price', array('class' => 'CButtonColumn', 'template' => '{view}{update}{delete}{images}', 'viewButtonUrl' => 'Yii::app()->createUrl("/shop/products/view",
array("id" => $data->product_id))', 'updateButtonUrl' => 'Yii::app()->createUrl("/shop/products/update",
array("id" => $data->product_id))', 'deleteButtonUrl' => 'Yii::app()->createUrl("/shop/products/delete",
array("id" => $data->product_id))', 'buttons' => array('images' => array('label' => Yii::t('ShopModule.shop', 'images'), 'url' => 'Yii::app()->createUrl("/shop/image/admin",
array("product_id" => $data->product_id))'))))));
echo CHtml::link(Shop::t('Create a new Product'), array('products/create'));
示例3: actionExport
public function actionExport()
{
$model = new Products();
$model->unsetAttributes();
// clear any default values
if (isset($_POST['Products'])) {
$model->attributes = $_POST['Products'];
}
$exportType = $_POST['fileType'];
$this->widget('ext.heart.export.EHeartExport', array('title' => 'List of Products', 'dataProvider' => $model->search(), 'filter' => $model, 'grid_mode' => 'export', 'exportType' => $exportType, 'columns' => array('product_id', 'name', 'measure_id')));
}