本文整理汇总了PHP中ViewList::processSearchForm方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewList::processSearchForm方法的具体用法?PHP ViewList::processSearchForm怎么用?PHP ViewList::processSearchForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewList
的用法示例。
在下文中一共展示了ViewList::processSearchForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processSearchForm
function processSearchForm()
{
parent::processSearchForm();
if (isset($_REQUEST['search_from_view']) and $_REQUEST['search_form_view'] == 'advanced_search') {
$field_p = 'province_c_advanced[]';
$field_c = 'city_c_advanced[]';
} else {
$field_p = 'province_c_basic[]';
$field_c = 'city_c_basic[]';
}
echo '<script language="javascript">
var c_obj = document.getElementsByName("' . $field_c . '");
var p_obj = document.getElementsByName("' . $field_p . '");
p_obj[0].onchange = function() {
var c_value = c_obj[0].value;
var success = function (data) {
if (data) {
c_obj[0].options.length = 0;
c_obj[0].innerHTML = data.responseText;
c_obj[0].value = c_value;
}
}
var path = "index.php?module=JrMis_Departments&action=getCityDropDownOptions&sugar_body_only=1&id="+this.value;
var cObj = YAHOO.util.Connect.asyncRequest("GET", path, {success: success, failure: success});
}
p_obj[0].onchange();
</script>';
}
示例2: testprocessSearchForm
public function testprocessSearchForm()
{
//test without use_old_search. it should return html.
$view = new ViewList();
$view->prepareSearchForm();
ob_start();
$view->processSearchForm();
$renderedContent = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0, strlen($renderedContent));
//test with use_old_search = true. there is a $view variable which is never set so it doesn't returns anything.
$view = new ViewList();
$view->prepareSearchForm();
$view->use_old_search = true;
ob_start();
$view->processSearchForm();
$renderedContent = ob_get_contents();
ob_end_clean();
$this->assertEquals(0, strlen($renderedContent));
}