我想要做的是添加一个elevatezoom画廊,并根据他们从mysql得到的结果创建这些小方块(如果photo1设置为任何位置,然后square1出现,如果photo2设置为位置,方块2出现,如果照片3是空的,没有出现(你的想法)空白页面诊断。如果问题
问题是,接下来的编辑后,我得到一个空白页。
这是整个代码。
<?php use_helper("StaticUrl");?>
<div class="product_image">
<?php
$href = url_for($product->getRouteUrl(ESC_RAW));
if ($sf_context->getActionName() == 'view')
{
$href = static_url_for($product->generatePhotoPath('large',ESC_RAW));
}
?>
<a <?php echo $sf_context->getActionName() == 'view' ? 'class="lightbox"' : ''; ?> href="<?php echo $href;?>" title="<?php echo $product; ?>">
<img src="<?php echo static_url_for($product->generatePhotoPath(ESC_RAW)); ?>" alt="<?php echo $product; ?>" data-zoom-image="<?php echo static_url_for($product->generatePhotoPath('large',ESC_RAW)); ?>" class="zoom" style="z-index:999999;" />
</a>
<?php
$resultt = Doctrine_Query::create()->from("Product")
->select("photo1")
->where("id = ?", $product_id)
->fetchOne(array(), Doctrine_Core::HYDRATE_ARRAY);
if (empty($resultt))
{
return sfView::NONE;
}
?>
<?php if(isset(resultt)){ ?>
<div id="gal1">
<a href="#" data-image="<?php echo url_for($product->generatePhotoPath("small", 1, ESC_RAW)); ?>" data-zoom-image="<?php echo url_for($product->generatePhotoPath("large", 1, ESC_RAW)); ?>">
<img id="img_01" src="<?php echo url_for($product->generatePhotoPath("small", 1, ESC_RAW)); ?>" />
</a>
<?php } ?>
<a href="#" data-image="<?php echo url_for($product->generatePhotoPath("small", 2, ESC_RAW)); ?>" data-zoom-image="<?php echo url_for($product->generatePhotoPath("large", 2, ESC_RAW)); ?>">
<img id="img_01" src="<?php echo url_for($product->generatePhotoPath("small", 2, ESC_RAW)); ?>" />
</a>
<a href="#" data-image="<?php echo url_for($product->generatePhotoPath("small", 3, ESC_RAW)); ?>" data-zoom-image="<?php echo url_for($product->generatePhotoPath("small", 3, ESC_RAW)); ?>">
<img id="img_01" src="<?php echo url_for($product->generatePhotoPath("small", 3, ESC_RAW)); ?>" />
</a>
</div>
</div>
<script src="/js/elevatezoom/jquery.elevatezoom.js" type="text/javascript"></script>
画廊&灯箱’检查你的日志 – aynber