About Smarty Plugins

Source: Internet
Author: User
Smarty Plug-in

Good morning everyone, huh?

I recently see the smarty template in the custom plug-in when a problem

Plug-in functions
function.a.php

function Smarty_function_a ($dat, $smarty) {

I would like to ask is here how to introduce my database class db.class.php class in the root directory under Include
At the same time, the introduction of conn.php,config.php in the database class is in the same directory
At the same time conn.php introduced config.php

}
?>


Reply to discussion (solution)

Different versions, different practices
But the file name should be the same as the function name, which is the same

Good morning everyone, huh?

I recently see the smarty template in the custom plug-in when a problem

Plug-in functions
function.a.php

function Smarty_function_a ($dat, $smarty) {

I would like to ask is here how to introduce my database class db.class.php class in the root directory under Include
At the same time, the introduction of conn.php,config.php in the database class is in the same directory
At the same time conn.php introduced config.php

}
?>

There's no need to introduce db.class.php.
Did you use the plugin again when you were using it on his basis?
So all you have to do in your function is the global $db, so you can use the functions in them by referencing the objects he has instantiated.

  • 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.