承接 stuartcusackie/sglide 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stuartcusackie/sglide

Composer 安装命令:

composer require stuartcusackie/sglide

包简介

A simple helper function for safely generating statamic glide image urls from fields as well as path strings.

README 文档

README

A simple helper function for safely generating Statamic glide image urls from fields as well as path strings.

Installation

composer require stuartcusackie/sglide

Publish

Don't forget to publish the config file and the missing image placeholder.

php artisan vendor:publish

Config

Set up your config file: config/sglide.php

Filesystems

If you want to use the default disk in the config file, i.e. 'assets', then you'll need to set up the filesystem in config/filesystem.php.

'assets' => [
    'driver' => 'local',
    'root' => public_path('assets'),
    'url' => '/assets',
    'visibility' => 'public',
],

This allows you to create glide images from your website's public folder.

Usage

** Using a Statamic Asset field inline **

<img src="{{ sglide($imageField, ['width' => 400, 'height' => 300, 'fm' => 'webp', 'fit' => 'crop'])->url }}" alt="XX" />

** Using a Statamic Asset in a component **

$this->imageUrl = sglide($imageField, [
    'width' => 700,
    'height' => 933,
    'fm' => 'webp',
    'fit' => 'crop_focal'
])->url;

** Using a path string **

<img src="{{ sglide('images/image1.jpg', ['width' => 400, 'height' => 300, 'fm' => 'webp', 'fit' => 'crop'])->url }}" alt="XX" />

统计信息

  • 总下载量: 31
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固