<a href="http://<?php echo $link; ?>/thelink.php">thelink</a>
PUG compiles to:
<a href="http://<?php echo $link; ?>/thelink.php">thelink</a>
My problem are "<" and ">".
How can i properly compile it to?:
<a href="http://<?php echo $link; ?>/thelink.php">thelink</a>
I recommend using Phug when using Pug with PHP.
You can then use PHP variables (and objects) within PHP pretty easily. See this example:
// PHP
mixin link($href, $name)
a(href=$href)&attributes($attributes)= $name
+link('/foo', 'foo')(class="btn")
PHUG transforms this to:
// HTML
<a class="btn" href="/foo">foo</a>
You can read more about this specific example in the documentation .
Use "!" before "=" :
a(href!="http://<?php echo $link; ?>/thelink.php") thelink
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.