Thinkphp cross-controller template output related issues
Source: Internet
Author: User
Thinkphp cross-Controller template output issues
Describe the problem first
Search under Home Index and assign the search results to the show template output under the show module.
Class Indexaction extends Action {// This is the index module
Public Function index () {
echo session ("UID");
$this->display ();
}
Public Function Dosearch () {//Fuzzy query
$user = M (' user ');
$key = $_request[' Keysearch ');
$where [' username '] = $key;
$where [' username '] = array ("Like", Array ("% $key", "$key%"));
Import (' ORG. Util.page ');//Import page-out class
$data = $user->where ($where)->select ();
$count = $user->where ($where)->count ();//number of conditional queries
$Page = new Page ($count, 3);//Instantiate the total number of incoming records for the paging class and the number of records displayed per page
foreach ($where as $key = = $val) {
if (!is_array ($val)) {
$Page->parameter. = "$key =". UrlEncode ($val). ' & ';
}
}
$this->display (' show/show ');// Assign the search results to the show model output under the show module
}
But once the search form address is submitted, it becomes http://www.tanss.com/alumni/index.php/Index/dosearch.
In fact, this seems to be no problem, but I need to work on the results of this search, such as messages, check the details and other operations, so when I write a message in the Show module, view details and other methods will be reported illegal operation, such as the problem how to deal with it,
------to solve the idea----------------------
Post an error to see
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service