twig to tpl {{'|的转换'〜作者}}

时间:2018-03-20 18:49:26

标签: opencart

{%if theme_option_status [store_id]%} {%if header_tag [store_id] .font_family == header_tag [store_id] .font_family%} {{a_tag [store_id] .color? 'a {color:#'~a_tag [store_id] .color〜'; }':''}} {{a_tag [store_id] .hover_color? 'a:hover {color:#'~a_tag [store_id] .hover_color~'; }':''}}

{{ total.title ~ " :" }}


{{ article.date_added_d ~ ' ' ~ article.date_added_m ~ ' ' ~ article.date_added_y }} 

{%if(count%rows == 0)或(count == articles | length)%}

{{ (i % 2 == 0) ? 'even' : 'odd' }}

{{“|”~article.author}}

{{ ' | ' ~ author }}

这是twig文件代码。我们怎样才能在tpl文件中编写这段代码。我正在将opencart 3.0.2.0主题转换为opencart 2.3.0.2。我面临的问题是将这些困难的线路转换为tpl php line。我已经完成了其他所有代码,但我无法做到这些代码行。意味着我怎么能在tpl中准确转换这一行。谢谢

1 个答案:

答案 0 :(得分:1)

if($ theme_option_status [' store_id']){         if($ header_tag [' store_id'] [' font_family'] == $ header_tag [' store_id'] [' font_family']){                 echo $ a_tag [' store_id'] [' color']? ' a {color:#' 。 $ a_tag [' store_id'] [' color']。 &#39 ;; }' :'&#39 ;;                 echo $ a_tag [' store_id'] [' hover_color']? ' a:悬停{color:#' 。 $ a_tag [' store_id'] [' hover_color']。 &#39 ;; }' :'';

            echo  $total['title'] . " :" ;

            echo $article['date_added_d'] . ' ' . $article['date_added_m'] . ' ' . $article['date_added_y'];  
            if (($count % $rows == 0) || $count == strlen($articles)) {

            echo ($i % 2 == 0) ? 'even' : 'odd' ;
            echo " | " . $article['author'];
            echo ' | ' . $author;
相关问题