本文整理汇总了PHP中Entry::search方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::search方法的具体用法?PHP Entry::search怎么用?PHP Entry::search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::search方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionGeneratePdf
public function actionGeneratePdf()
{
$this->layout = 'pdf';
$model = new Entry('search');
if (isset($_GET['Entry'])) {
$model->attributes = $_GET['Entry'];
}
// to execute the filters (if is the case)
$dataProvider = $model->search();
$dataProvider->pagination = false;
$mPDF1 = Yii::app()->ePdf->mpdf();
# You can easily override default constructor's params
$mPDF1 = Yii::app()->ePdf->mpdf('', 'A5');
# renderPartial (only 'view' of current controller)
$mPDF1->WriteHTML($this->renderPartial('admin', array('model' => $model), true));
# Outputs ready PDF
$mPDF1->Output();
}
示例2: die
$page_number = filter_var($_GET["page"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH);
if (!is_numeric($page_number)) {
die("Неверный номер страницы!");
}
if ($page_number < 1) {
$page_number = 1;
}
} else {
$page_number = 1;
}
// if search do this
if (isset($_GET["search"]) && !empty($_GET["search"])) {
$search = $_GET["search"];
$search = trim($search);
$search = strip_tags($search);
$entry->search($search);
} else {
if (isset($_GET["sort"]) && isset($_GET["order"]) && ($_GET["sort"] == "name" || $_GET["sort"] == "url") && ($_GET["order"] == "up" || $_GET["order"] == "down")) {
$sort = $_GET["sort"];
$order = $_GET["order"];
$entry->get_result($page_number, $sort, $order);
} else {
$entry->get_result($page_number, "", "");
}
}
?>
</table>
<!-- begin pagination -->
<div class="text-center">
<nav>
示例3: getCustomerHistory
function getCustomerHistory($id)
{
if (is_null($id)) {
Functions::setResponse(400);
}
try {
$c = new Customer($id);
$whereClause = 'customer_id = :cid';
$params = array(array('id' => ':cid', 'value' => $id, 'type' => PDO::PARAM_INT));
return Entry::search($whereClause, $params);
} catch (RuntimeException $e) {
if (!isset($c)) {
Functions::setResponse(404);
}
}
}