OpenCart pass variable to twig from controller
问题 Hy! I need to use some data in twig files, how do I pass it from header.php to twig files? I created a new element in $data array, but It doesn't exist in the twig files. $data['testvar'] = "test string"; And I try to access it in twig files like this: {{ testvar }} 回答1: After you made some changes, you must in admin dashboard refresh your modifications and clear cache, blue gear icon in right upper corner. 回答2: If you add $data['testvar'] = "test string"; only in catalog/controller/common