当前位置: 首页>>代码示例>>PHP>>正文


PHP search::query方法代码示例

本文整理汇总了PHP中search::query方法的典型用法代码示例。如果您正苦于以下问题:PHP search::query方法的具体用法?PHP search::query怎么用?PHP search::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在search的用法示例。


在下文中一共展示了search::query方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

    ?>
   	<h1><?php 
    echo $results->pagination->countItems();
    ?>
 
   	<?php 
    if ($results->pagination->countItems() == '1') {
        ?>
   	result<?php 
    } else {
        ?>
results<?php 
    }
    ?>
   	for <em><?php 
    echo $search->query();
    ?>
</em></h1>
   	<?php 
}
?>
   

   	<?php 
if ($results) {
    ?>

   	<table>
   		<thead>
   			<tr>
   				<th>Project</th>
开发者ID:aguynamedirvin,项目名称:Smart-Projects-Kirby-Theme,代码行数:31,代码来源:search.php

示例2: snippet

			</p>				
		</div>		
	</div>
	<?php 
    }
    ?>
	<div class="row">
		<div class="slot-6-7-8-9">
			<?php 
    snippet('pagination', array('pagination' => $results->pagination()));
    ?>
				
		</div>		
	</div>
	<?php 
} elseif ($search->query()) {
    ?>
	<div class="row">
		<div class="slot-6-7-8-9">
			<h3>No posts found matching «<?php 
    echo html($search->query());
    ?>
».</h3>
			<p>Your search for <strong><?php 
    echo html($search->query());
    ?>
</strong> returned no results.</p>				
		</div>		
	</div>
	<?php 
}
开发者ID:niklausgerber,项目名称:monochrome,代码行数:31,代码来源:search.php

示例3: html

?>

<?php 
snippet_detect('html_head', array('criticalcss' => false, 'prev_next' => false, 'prerender' => false));
?>

	<?php 
snippet('banner');
?>

	<main role="main" class="Contain Copy">

		<h1>
			<?php 
if (!empty($results)) {
    echo $pagination->countItems() . " searchresult(s) for <mark>" . $search->query() . "</mark>";
} else {
    echo $page->title()->smartypants()->widont();
}
?>
		</h1>

		<form action="<?php 
echo $page - url();
?>
">
			<input type="text" placeholder="Type in your searchword…" name="q" value="<?php 
echo html($search->query());
?>
" class="TextInput" />
			<input type="submit" value="Search" class="Btn Btn--fancy" />
开发者ID:veryrobert,项目名称:altair,代码行数:31,代码来源:search.php

示例4: isset

if (!empty($_POST)) {
    $accountId = isset($_POST['accountId']) ? $_POST['accountId'] : '';
    $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
    $query = isset($_POST['query']) ? $_POST['query'] : '';
    $userId = isset($_POST['userId']) ? $_POST['userId'] : 0;
    $gender = isset($_POST['gender']) ? $_POST['gender'] : -1;
    $online = isset($_POST['online']) ? $_POST['online'] : -1;
    $ageFrom = isset($_POST['ageFrom']) ? $_POST['ageFrom'] : 13;
    $ageTo = isset($_POST['ageTo']) ? $_POST['ageTo'] : 110;
    $query = helper::clearText($query);
    $query = helper::escapeText($query);
    $userId = helper::clearInt($userId);
    if ($gender != -1) {
        $gender = helper::clearInt($gender);
    }
    if ($online != -1) {
        $online = helper::clearInt($online);
    }
    $ageFrom = helper::clearInt($ageFrom);
    $ageTo = helper::clearInt($ageTo);
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $search = new search($dbo);
    $search->setRequestFrom($accountId);
    $result = $search->query($query, $userId, $gender, $online, $ageFrom, $ageTo);
    echo json_encode($result);
    exit;
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:app.search.inc.php


注:本文中的search::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。