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


PHP Image::url方法代码示例

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


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

示例1: getAvatar

 public function getAvatar($size = 100)
 {
     if (empty($this->entity->logo)) {
         return \Theme::asset()->img('theme/images/game/logo.jpg');
     }
     return \Image::url($this->entity->logo, $size);
 }
开发者ID:weddingjuma,项目名称:world,代码行数:7,代码来源:GamePresenter.php

示例2: render

 public function render($path, $param = [], $setting = [])
 {
     $predefinedSettings = ['title' => $this->setTitle()];
     if ($this->exists()) {
         $predefinedSettings = array_merge($predefinedSettings, ['design' => $this->community->present()->readDesign()]);
     }
     $settings = array_merge($predefinedSettings, $setting);
     if (\Config::get('page-design') and isset($settings['design'])) {
         extract($settings['design']);
         $bgImage = !empty($bg_image) ? 'background-image:url(' . \Image::url($bg_image) . ');' : null;
         $this->theme->asset()->afterStyleContent("\n                body{\n                    " . $bgImage . "\n                    background-position: " . $bg_position . ";\n                    background-color: " . $bg_color . ";\n                    background-repeat: " . $bg_repeat . ";\n                    background-attachment : " . $bg_attachment . ";\n                }\n\n                a {\n                    color : " . $link_color . ";\n                }\n\n                .page-content{\n                    background-color: " . $content_bg_color . ";\n                }\n            ");
     }
     return parent::render('community.page.layout', ['content' => $this->theme->section($path, $param)], $settings);
 }
开发者ID:adamendvy89,项目名称:intifadah,代码行数:14,代码来源:CommunityPageBaseController.php

示例3: update

    public function update(Image $image)
    {
        $query = $this->_db->prepare(' UPDATE t_image SET 
		name=:name, url=:url, description=:description, idProjet=:idProjet, updated=:updated, updatedBy=:updatedBy
		WHERE id=:id') or die(print_r($this->_db->errorInfo()));
        $query->bindValue(':id', $image->id());
        $query->bindValue(':name', $image->name());
        $query->bindValue(':url', $image->url());
        $query->bindValue(':description', $image->description());
        $query->bindValue(':idProjet', $image->idProjet());
        $query->bindValue(':updated', $image->updated());
        $query->bindValue(':updatedBy', $image->updatedBy());
        $query->execute();
        $query->closeCursor();
    }
开发者ID:aassou,项目名称:AnnahdaWebsiteCanvas,代码行数:15,代码来源:ImageManager.php

示例4: uploadBg

 /**
  * Ajax serving
  */
 public function uploadBg()
 {
     $error = json_encode(['response' => 0, 'message' => trans('photo.error', ['size' => formatBytes()])]);
     if (\Request::hasFile('image')) {
         if (!$this->photoRepository->imagesMetSizes(\Input::file('image'))) {
             return $error;
         }
         if ($image = $this->userRepository->changeDesignBg(\Input::file('image'), \Input::get('val.bg_image'))) {
             return json_encode(['response' => 1, 'image' => \Image::url($image), 'imagePath' => $image]);
         } else {
             return $error;
         }
     }
     return $error;
 }
开发者ID:adamendvy89,项目名称:intifadah,代码行数:18,代码来源:AccountController.php

示例5: changePhoto

 public function changePhoto()
 {
     $id = \Input::get('id');
     $game = $this->gameRepository->get($id);
     $response = ['code' => 0, 'message' => trans('photo.error', ['size' => formatBytes()]), 'url' => ''];
     if (\Request::hasFile('image')) {
         if (!$this->photoRepository->imagesMetSizes(\Input::file('image'))) {
             return json_encode($response);
         }
         $image = $this->gameRepository->changePhoto(\Input::file('image'), $game);
         if ($image) {
             $response['code'] = 1;
             $response['url'] = \Image::url($image, 100);
         }
     }
     return json_encode($response);
 }
开发者ID:weddingjuma,项目名称:world,代码行数:17,代码来源:GameController.php

示例6: render

 public function render($path, $param = [], $setting = [])
 {
     $predefinedSettings = [];
     if (\Auth::check()) {
         /**
          * If there is login we help this user to design his page
          */
         $predefinedSettings = array_merge($predefinedSettings, ['design' => \Auth::user()->present()->readDesign()]);
     }
     $settings = array_merge($predefinedSettings, $setting);
     if (\Config::get('page-design') and isset($settings['design'])) {
         extract($settings['design']);
         $bgImage = !empty($bg_image) ? 'background-image:url(' . \Image::url($bg_image) . ');' : 'background-image : none';
         $this->theme->asset()->afterStyleContent("\n                body{\n                    " . $bgImage . "\n                    background-position: " . $bg_position . ";\n                    background-color: " . $bg_color . ";\n                    background-repeat: " . $bg_repeat . ";\n                    background-attachment : " . $bg_attachment . ";\n                }\n\n                a {\n                    color : " . $link_color . ";\n                }\n\n                .page-content{\n                    background-color: " . $content_bg_color . ";\n                }\n            ");
     }
     return parent::render($path, $param, $settings);
 }
开发者ID:weddingjuma,项目名称:world,代码行数:17,代码来源:UserBaseController.php

示例7: cropCover

 public function cropCover($id)
 {
     $top = \Input::get('top');
     $failed = json_encode(['status' => 'error', 'message' => trans('photo.error', ['size' => formatBytes()])]);
     $page = $this->pageRepository->get($id);
     if (!$page or !$page->isOwner()) {
         return $failed;
     }
     $image = $this->photo->cropImage(base_path($page->original_cover), 'cover/', 0, abs($top), 1000, 300, false);
     $image = str_replace('%d', 'original', $image->result());
     if (!empty($image)) {
         /**
          * Update user profile cover
          */
         if ($page->cover and $page->cover != $page->original_cover) {
             \Image::delete($page->cover);
         }
         $page->cover = $image;
         $page->save();
         return json_encode(['status' => 'success', 'url' => \Image::url($image)]);
     } else {
         return json_encode(['status' => 'error', 'message' => 'Error things']);
     }
 }
开发者ID:weddingjuma,项目名称:world,代码行数:24,代码来源:PageController.php

示例8: testServeWrongFormat

 public function testServeWrongFormat()
 {
     $url = Image::url('/wrong.jpg', 300, 300, array('crop' => true));
     $this->setExpectedException('Folklore\\Image\\Exception\\FormatException');
     $response = $this->call('GET', $url);
 }
开发者ID:sonjoysam,项目名称:laravel-image,代码行数:6,代码来源:ImageTestCase.php

示例9: cropCover

 public function cropCover()
 {
     $top = \Input::get('imgY1');
     $left = \Input::get('imgX1');
     $cWidth = \Input::get('cropW');
     $cHeight = \Input::get('cropH');
     $file = \Input::get('imgUrl');
     $file = str_replace([\URL::to(''), '//'], ['', '/'], $file);
     $id = \Input::get('id');
     $image = $this->photo->cropImage(base_path('') . $file, 'cover/', $left, $top, $cWidth, $cHeight, false);
     $image = str_replace('%d', 'original', $image->result());
     /**make sure to delete the original image***/
     $this->photo->delete($file);
     if (!empty($image)) {
         /**
          * Update user profile cover
          */
         $this->eventRepository->updateCover($id, $image);
         return json_encode(['status' => 'success', 'url' => \Image::url($image)]);
     } else {
         return json_encode(['status' => 'error', 'message' => 'Error ']);
     }
 }
开发者ID:adamendvy89,项目名称:intifadah,代码行数:23,代码来源:EventController.php

示例10:

    @if ($user)

        <div class="col-xs-12">

            <div class="alert alert-info">Add new image by clicking on the + icon on the left sidebar.</div>

            <div class="grid">
                <div class="grid-sizer"></div>
                @foreach($images as $image)
                    <div class="grid-item {{ $image['status'] }}" data-id="{{ $image['id'] }}" data-status="{{ $image['status']  }}"
                         data-preview="<?php 
echo Image::url('/uploads/images/' . $image['path'], 400);
?>
">
                        <img src="<?php 
echo Image::url('/uploads/images/' . $image['path'], 200, 300);
?>
"/>
                    </div>
                @endforeach
            </div>

        </div>

    @else

        <div class="col-xs-12">

            <div class="well" style="background-color: #fff">

                <p>We use the OCR capability of Google Drive to perform the image to text conversion of your documents. Thus we need you to sign in using your Google Account and grant access to your Google Drive for performing the OCR.</p>
开发者ID:phpfour,项目名称:bangla-ocr,代码行数:31,代码来源:index.blade.php

示例11: uploadImage

 public function uploadImage()
 {
     $result = ['code' => 0, 'message' => trans('post.post-image-error')];
     if ($image = \Input::file('image')) {
         $uploadImage = $this->postRepository->uploadImage($image);
         if ($uploadImage) {
             $result['image'] = $uploadImage;
             $result['imageurl'] = \Image::url($uploadImage, 100);
             $result['code'] = 1;
         }
     }
     return json_encode($result);
 }
开发者ID:adamendvy89,项目名称:intifadah,代码行数:13,代码来源:PostController.php

示例12: getLogo

 public function getLogo()
 {
     if (empty($this->entity->logo)) {
         return \Theme::asset()->img('theme/images/community/cover.jpg');
     }
     return \Image::url($this->entity->logo);
 }
开发者ID:adamendvy89,项目名称:intifadah,代码行数:7,代码来源:CommunityPresenter.php

示例13: readDesign

 public function readDesign($type = 'profile')
 {
     $design = ['enable' => false];
     $userDesign = !empty($this->entity->design_info) ? perfectUnserialize($this->entity->design_info) : [];
     $userDesign = !$userDesign ? [] : $userDesign;
     $design = array_merge($design, $userDesign);
     if (isset($design[$type])) {
         $design = $design[$type];
     }
     /**
      * @var $enable
      * @var $theme
      */
     extract($design);
     if ($enable) {
         $design['bg_image'] = \Image::url($design['bg_image']);
     }
     if (!$enable) {
         $themeDesign = \Theme::option()->get('design-themes');
         $themeDesign = (empty($theme) or !isset($themeDesign[$theme])) ? $themeDesign['default'] : $themeDesign[$theme];
         /**
          * Reset the design to this selected one
          */
         $design['bg_image'] = $themeDesign['background-image'];
         $design['bg_color'] = $themeDesign['background-color'];
         $design['bg_attachment'] = $themeDesign['background-attachment'];
         $design['bg_position'] = $themeDesign['background-position'];
         $design['bg_repeat'] = $themeDesign['background-repeat'];
         $design['link_color'] = $themeDesign['link-color'];
         $design['content_bg_color'] = $themeDesign['page-content-bg-color'];
     }
     return $design;
 }
开发者ID:weddingjuma,项目名称:world,代码行数:33,代码来源:UserPresenter.php

示例14: cropCover

 public function cropCover()
 {
     $top = \Input::get('top');
     $image = $this->photo->cropImage(base_path(\Auth::getUser()->original_cover), 'cover/', 0, abs($top), 1000, 300, false);
     $image = str_replace('%d', 'original', $image->result());
     if (!empty($image)) {
         /**
          * Update user profile cover
          */
         $user = \Auth::user();
         if ($user->cover and $user->cover != $user->original_cover) {
             \Image::delete($user->cover);
         }
         $this->userRepository->updateCover($image);
         return json_encode(['status' => 'success', 'url' => \Image::url($image)]);
     } else {
         return json_encode(['status' => 'error', 'message' => 'Error things']);
     }
 }
开发者ID:weddingjuma,项目名称:world,代码行数:19,代码来源:ProfileController.php

示例15: coverImage

 public function coverImage()
 {
     if (!empty($this->entity->cover)) {
         return \Image::url($this->entity->cover);
     }
 }
开发者ID:adamendvy89,项目名称:intifadah,代码行数:6,代码来源:EventPresenter.php


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