LoginSignup
0
1

More than 5 years have passed since last update.

CS-Cart: Smartyでグローバルに使える変数を追加する

Posted at

CS-Cartのテンプレートでどこでも使える変数を追加する方法です。

フックを設定する

テンプレート初期化フックにかんで、Smartyプラグインを登録するコードを実装します。

app/addons/$addon_id/init.php
fn_register_hooks(
    'init_templater_post'
);
app/addons/$addon_id/func.php
function fn_{addon_id}_init_templater_post(Tygh\SmartyEngine\Core $view)
{
    $view->assign('blog_url', 'http://blog.example.com');
}

関連

CS-Cart: Smartyプラグインを追加する方法 - Qiita

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1