SkillAgentSearch skills...

Jphps

Unmarked PHP template

Install / Use

/learn @zswang/Jphps
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

jphps(<%>)

NPM version Build Status Coverage Status

处理前

function renderItem($item) {
  if (isset($item)) {
  <li>
    <a href="!#{$item['url']}">#{$item['title']}</a>
  </li>
  }
}

<ul>
renderItem(array('url' => 'http://google.com/', 'title' => 'Google'));
renderItem(array('url' => 'http://www.baidu.com/', 'title' => '百度'));
</ul>

处理后

<?php function renderItem($item) {
  if (isset($item)) { ?>
  <li>
    <a href="<?php echo $item['url'] ?>"><?php echo htmlentities($item['title']) ?></a>
  </li>
<?php   }
} ?>

<ul>
<?php renderItem(array('url' => 'http://google.com/', 'title' => 'Google'));
renderItem(array('url' => 'http://www.baidu.com/', 'title' => '百度')); ?>
</ul>

运行后


<ul>
  <li>
    <a href="http://google.com/">Google</a>
  </li>
  <li>
    <a href="http://www.baidu.com/">百度</a>
  </li>
</ul>

License

MIT © zswang

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated8y ago
Forks1

Languages

JavaScript

Security Score

60/100

Audited on Nov 8, 2017

No findings