0

I'm beginer in smarty My php function is:

   public function list_special() {
        Session::set('was_in_special', 'true');
        if (isset($_GET['showall']) && $_GET['showall'] == 'yes') {
            TPL::$s->assign('products', $this->proc->getSpecialProducts('true'));
        } else {
            TPL::$s->assign('products', $this->proc->getSpecialProducts());
        }
        TPL::$s->assign('title', 'Specialus katalogas - norėdami papildyti specialiųjų kainų sąraša, susisiekite su savo vadybininku.');
        //TPL::$s->assign('products', $this->proc->getSpecialProducts());
        TPL::$s->assign("pages_num", $this->proc->get_special_products_pages());
        TPL::$s->assign("parameters", Request::$params[1] . "/" . Request::$params[2] . "/");
        echo TPL::$s->fetch('catalog.products.html');
    }

I want call this function in one page , I try use {products} but this nothing display for me

1 Answer 1

1

Maybe you should register the object in before display, then call method in template like this:

{object->method p1='xx' p2='xx'}

look here. http://www.smarty.net/docsv2/en/advanced.features.tpl

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.