Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

код tpl в twig


 Share

Recommended Posts

Ребяи кто разбирается в twig подскажите ггде тут ошибки?

 

 

   $html = '<div class="social_icons_vt" style="right:'.$social_icons_vt['right'].'px;bottom:'.($social_icons_vt['bottom'] + 53).'px">';
                foreach ($social_icons_vt as $key => $icon_vt){
                    
                        $html .= '<a class="icon_vt ' . $key . '" href="'. $icon_vt . '" target = "_blank"></a>';
                    
                }
            $html .= '</div>';
            $data['social_icons_vt'] = $html;

Link to comment
Share on other sites


5 минут назад, Venter сказал:

зачем скобки???

Потому что без скопотому чток фигня полулится. Это для чего надо скобки.

  • +1 1
Link to comment
Share on other sites


5 часов назад, munhgauzen сказал:

Ребяи кто разбирается в twig подскажите ггде тут ошибки?

 

 

   $html = '<div class="social_icons_vt" style="right:'.$social_icons_vt['right'].'px;bottom:'.($social_icons_vt['bottom'] + 53).'px">';
                foreach ($social_icons_vt as $key => $icon_vt){
                    
                        $html .= '<a class="icon_vt ' . $key . '" href="'. $icon_vt . '" target = "_blank"></a>';
                    
                }
            $html .= '</div>';
            $data['social_icons_vt'] = $html;


Если это используется в контроллере, то ошибки никакой нет, если это пихаете в twig шаблон, то зачем им $data['social_icons_vt'] = $html;
и если по теме твига разбирать, то этот код вообещё даже в tpl рилиить не  бугдет. 
Опрегделитесь с задачей.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.