summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Portlets/SearchPortlet.php
blob: 1bad7f1cdc724da1e41bac6e4543bcfe040ed933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

Prado::using('Application.Portlets.Portlet');

class SearchPortlet extends Portlet
{
	public function onInit($param)
	{
		parent::onInit($param);
		if(!$this->Page->IsPostBack && ($keyword=$this->Request['keyword'])!==null)
			$this->Keyword->Text=$keyword;
	}

	public function search($sender,$param)
	{
		$keyword=$this->Keyword->Text;
		$url=$this->Service->constructUrl('SearchPost',array('keyword'=>$keyword));
		$this->Response->redirect($url);
	}
}

?>