简体   繁体   中英

how can I change code in .twig in open cart theme

I want change in code of open cart theme but all files is .twig so when I write php code in it don't work . until when i change in the stylesheet file . the theme don't see any changes.

how I can change .twig to php and make the theme see the changes in css file ??

this is part of header.twig

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ title }}</title>
<base href="{{ base }}" />
{% if description %}
<meta name="description" content="{{ description }}" />
{% endif %}
{% if keywords %}
<meta name="keywords" content="{{ keywords }}" />
{% endif %}
<script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,400i,300,700" rel="stylesheet" type="text/css" />

I want to add this code to it but when I put it in header.twig it don't work

<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/style.css">
<?php if($direction=='rtl'){?>
   <link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/rtl-style.css">
<?php }?>

使用此扩展来启用树枝: https ://www.opencart.com/index.php ? route = marketplace/extension/info & extension_id =29835

You really shouldn't mix PHP with TWIG. Just use passed variables. Check the documentation for more info: https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=29835

https://twig.symfony.com/doc/2.x/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM