php 判断语句在phtml文件中无法被解释 5
学习zendMVC,网上的一个教程,源码如下:<?phpif($this->album):?><p>Areyousurethatyouwanttodelete'<?php...
学习zend MVC,网上的一个教程,源码如下:
<?php if($this->album) :?>
<p>Are you sure that you want to delete
'<?php echo $this->album->tilte;?>' by
'<?php echo $this->album->artist;?>'
</p>
<form action = "<?php echo $this->url(array('action'=>'delete'));?>" method = "post">
<div>
<input type = "hidden" name = "id" value = "<?php echo $this->album->id;?>" />
<input type = "submit" name = "del" value = "Yes"/>
<input type = "submit" name = "del" value = "No"/>
</div>
</form>
<?php else :?>
<p>Cannot find album.</p>
<?php endif;?>
结果输出如下:
An error occurred
Application error
自己测试,去掉form还是出现问题,只有把整个判断语句去掉就好了,问题的根源在哪里,求指教 展开
<?php if($this->album) :?>
<p>Are you sure that you want to delete
'<?php echo $this->album->tilte;?>' by
'<?php echo $this->album->artist;?>'
</p>
<form action = "<?php echo $this->url(array('action'=>'delete'));?>" method = "post">
<div>
<input type = "hidden" name = "id" value = "<?php echo $this->album->id;?>" />
<input type = "submit" name = "del" value = "Yes"/>
<input type = "submit" name = "del" value = "No"/>
</div>
</form>
<?php else :?>
<p>Cannot find album.</p>
<?php endif;?>
结果输出如下:
An error occurred
Application error
自己测试,去掉form还是出现问题,只有把整个判断语句去掉就好了,问题的根源在哪里,求指教 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询