<!-- 收集script片段并分析其依赖。 如果不想改变内嵌js的位置可以不用php包裹,但注意此时可能modjs还没加载 --> <?php scriptStart(); ?> <script type="text/javascript"> require.async('widget/scroll/scroll.js',function(scroll){ scroll.init(); }) </script> <?php scriptEnd(); ?> <!-- 您也可以通过注释在html中声明依赖 --> <!-- @require "widget/footer/test.css" --> <!-- js输出位置,放在底部加快页面解析 --> <?php placeholder('js'); ?> </body> </html>
function nowikiPlaceholder($matches) { global $nowiki; $nowiki[] = $matches[1]; return placeholder(); }
public function testAliasForUnicodePlaceholderFunction() { $this->assertSame(…(), placeholder()); }
<div class="col-xs-2" align="center"> <div class="profile composer-profile" style="background-image:url('/assets/avatars/<?php echo $user['user_name']; ?> .jpg');"></div> </div> <div class="col-xs-10"> <div class="composer" align="right"> <form action="" method="POST"> <input type="hidden" name="user_id" value="<?php echo $user_id; ?> " /> <input type="hidden" name="action" value="create_post" /> <textarea class="form-control" name="body" id="post_body" placeholder="<?php echo placeholder(); ?> "></textarea> <button class="btn btn-success" name="submit" disabled> Post <span class='char_count'></span> </button> </form> <cite>HTML is accepted</cite> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-lg-12 post-header">