私がしようとしているのは、エレベータズームギャラリーを追加し、mysqlから得た結果に基づいてそれらの小さな四角形を作成することです(photo1が任意の場所に設定されている場合はsquare2が表示され、図2は、写真3が空の場合、何も表示されない、表示された問題は、次の編集後、私は空白のページを取得していますされ空白のページを診断します。 IF問題
(あなたのアイデアを得る)。
はこれは、全体のコードです。
<?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