thinkphp Script Management Code

Source: Internet
Author: User
thinkphp Article Management Code

How to encapsulate yourself:

function wenzhang1 ($chart = ") {
$user =d ($chart);

$list = $user->where ("Products_category=1")->select ();
Thumbremoveorigin

$this->assign ("Wenzhang1", $list);

}
function wenzhang2 ($chart = ") {
$user =d ($chart);

$list = $user->where ("products_category=2")->select ();
Thumbremoveorigin

$this->assign ("Wenzhang2", $list);

}
function Wenzhang3 ($chart = ") {
$user =d ($chart);

$list = $user->where ("products_category=3")->select ();
Thumbremoveorigin

$this->assign ("Wenzhang3", $list);

}
function Wenzhang4 ($chart = ") {
$user =d ($chart);

$list = $user->where ("products_category=4")->select ();
Thumbremoveorigin

$this->assign ("Wenzhang4", $list);

}
function Wenzhang5 ($chart = ") {
$user =d ($chart);

$list = $user->where ("products_category=5")->select ();
Thumbremoveorigin

$this->assign ("Wenzhang5", $list);

}
function Wenzhangxi ($chart = ', $pid = ') {
$user =d ($chart);

$list = $user->where ("products_id=". $pid. ") ->select ();
Thumbremoveorigin

$this->assign ("Wenzhangxi", $list);

}
function Wenzhangx () {
$this->wenzhang1 (' Wenzhang ');
$this->wenzhang2 (' Wenzhang ');
$this->wenzhang3 (' Wenzhang ');
$this->wenzhang4 (' Wenzhang ');
$this->wenzhang5 (' Wenzhang ');


}


Background Code :

Add this sentence in the background code (call the encapsulated method, above)

$this->wenzhangx ();


Front Display code:



Payment Methods



{$vo. Products_name}









Delivery method



{$vo. Products_name}













  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.