本文整理汇总了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')));
}