我将如何将此代码转换为一个元素以在我的 Web 应用程序中重用?
<div class="row">
<?php foreach ($mobiles as $mobile): ?>
<ul class="product-listing unstyled">
<li>
<a href="<?php echo $this->webroot . 'mobiles/view/'.$mobile['Mobile']['id']; ?>">
<img src="<?php echo $this->webroot; echo 'files/files'.$mobile['Mobile']['filename']; ?>" alt="<?php echo $mobile['Mobile']['productname']; ?>" />
<div class="pricing pull-right">€<?php echo $mobile['Mobile']['price']; ?> </div>
<h3><?php echo $mobile['Mobile']['productname']; ?></h3>
</a>
</li>
</ul>
<?php endforeach; ?>
</div>