当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_View_Abstract::imageUrl方法代码示例

本文整理汇总了PHP中Zend_View_Abstract::imageUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Abstract::imageUrl方法的具体用法?PHP Zend_View_Abstract::imageUrl怎么用?PHP Zend_View_Abstract::imageUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_View_Abstract的用法示例。


在下文中一共展示了Zend_View_Abstract::imageUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: eventWidget

    public function eventWidget($limit, $show_thumbnails = false, $side_space = true)
    {
        $languageId = Zend_Registry::get('languageId');
        $cache = Zend_Registry::get('cache');
        if (($widget = $cache->load('widget_event')) === false) {
            $title = $this->view->translate('recent_events');
            $tbl_event = new Model_DbTable_Event();
            $events = $tbl_event->getEventLatestByIdLang($languageId, null, $limit);
            $list = "<ul>";
            $thumbnails = '';
            foreach ($events as $event) {
                $urlFormat = $this->view->makeUrlFormat($event['name']);
                $link = $this->view->baseUrl("event/detail/{$event['event_id']}/{$urlFormat}");
                if ($show_thumbnails) {
                    $source = 'default.jpg';
                    $image_dir = UPLOAD_FOLDER . 'event/';
                    $width = 50;
                    $height = 50;
                    $quality = 100;
                    if (file_exists($image_dir . $event['main_pics']) && !empty($event['main_pics'])) {
                        $source = "upload/event/{$event['main_pics']}";
                    }
                    $thumb = $this->view->imageUrl("timthumb.php?src={$source}&w={$width}&h={$height}&q={$quality}");
                    $thumbnails = "<img class='thumbnail' src='{$thumb}' alt='{$event['name']}' />";
                }
                $list .= "<li>{$thumbnails}<a href='{$link}'><span class='desc'>{$event['name']}</span></a></li>";
            }
            $list .= "</ul>";
            $list .= "<div class='clear'></div>";
            if ($side_space) {
                $side_space_class = 'side-space';
            }
            $widget = <<<HTML
        <div class="widget-half-list {$side_space_class}">         
          <h2>{$title}</h2>            
          {$list}      
        </div>
HTML;
            $cache->save($widget);
        }
        return $widget;
    }
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:42,代码来源:EventWidget.php

示例2: cultureWidget

    public function cultureWidget($limit, $show_thumbnails = false, $side_space = true)
    {
        $languageId = Zend_Registry::get('languageId');
        $cache = Zend_Registry::get('cache');
        if (($widget = $cache->load('widget_kebudayaan')) === false) {
            $title = $this->view->translate('popular_culture');
            $tbl_culture = new Model_DbTable_Destination();
            $cultures = $tbl_culture->getFeaturedCulture($languageId, $limit);
            $list = "<ul>";
            $thumbnails = '';
            foreach ($cultures as $culture) {
                $urlFormat = $this->view->makeUrlFormat($culture['name']);
                $link = $this->view->baseUrl("culture/{$culture['poi_id']}/{$urlFormat}");
                if ($show_thumbnails) {
                    $source = 'default.jpg';
                    $width = 50;
                    $height = 50;
                    $quality = 100;
                    $culture_image = 'upload/culture/' . $culture['image'];
                    if (!file_exists(IMAGE_FOLDER . $culture_image) || empty($culture['image'])) {
                        $culture_image = $source;
                    }
                    $timthumb = $this->view->imageUrl("timthumb.php?src={$culture_image}&w={$width}&h={$height}&q={$quality}");
                    $thumbnails = "<img class='thumbnail' src='{$timthumb}' alt='{$culture['name']}' />";
                }
                $list .= "<li>{$thumbnails}<a href='{$link}'><span class='desc'>{$culture['name']}</span></a></li>";
            }
            $list .= "</ul>";
            $list .= "<div class='clear'></div>";
            if ($side_space) {
                $side_space_class = 'side-space';
            }
            $widget = <<<HTML
    <div class="widget-half-list {$side_space_class}">         
        <h2>{$title}</h2>        
        {$list}        
      </div>
HTML;
            $cache->save($widget);
        }
        return $widget;
    }
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:42,代码来源:CultureWidget.php


注:本文中的Zend_View_Abstract::imageUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。