當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。