[英]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 . 我想更改打开购物车主题的代码,但所有文件均为.twig,因此当我在其中编写php代码时不起作用。 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 ?? 我怎样才能将.twig更改为php,并使主题看到css文件中的更改?
this is part of header.twig 这是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 我想向其中添加此代码,但是当我将其放入header.twig时不起作用
<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 }?>
You really shouldn't mix PHP with TWIG. 您真的不应该将PHP与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 : //www.opencart.com/index.php?route= marketplace/ extension/ info &extension_id=29835
https://twig.symfony.com/doc/2.x/ https://twig.symfony.com/doc/2.x/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.