Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add practical examples showing facade alternatives to Antlers tags

Đang mở
#1,770 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
laravel, php
Lĩnh vực
documentation

Hướng nghiên cứu

Start with the Blade documentation sections covering Antlers Blade Components and fluent tags, then locate the relevant facade API references for Glide, collections, taxonomies, and navigation. Add practical facade examples for common Antlers tags and explain when they suit simple data access; done means the Blade docs show clear, accurate equivalents for the examples in the issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The current Blade documentation shows two approaches for using Statamic features in Blade:

  1. Antlers Blade Components (<s:glide>) - verbose for simple use cases
  2. Fluent tags (Statamic::tag('glide')) - awkward syntax, not discoverable

However, there's a cleaner approach using facades that isn't documented at all.

For example: Image Manipulation (Glide), the docs currently show:

{{-- Using fluent tags --}}
<img src="{{
 Statamic::tag('glide')->src('test.png')->width(1280)->height(800)->fetch() }}"
/>

{{-- Using Antlers Blade Components --}}
<s:glide src="test.png" width="1280" height="800">
 <img src="{{ $url }}" />
</s:glide>

The second approach is clunky if you're just wanting the URL, so you're forced to use Statamic::tag() everywhere if you just want the data, but there's a much cleaner facade approach that isn't documented:

<img src="{{ Image::manipulate('test.png', ['w' => 1280, 'h' => 800]) }}" />

I prefer using Facades because it's more Laravel-like and familiar to developers, and also better IDE autocomplete support. It's also a cleaner syntax for simple use cases.

Suggestion

The Blade documentation should include a section showing facade equivalents for common Antlers tags. For example:

Collections:

// Instead of: Statamic::tag('collection:wheels')->limit(3)
Collection::findByHandle('wheels')->queryEntries()->limit(3)->get()

Taxonomies:

// Instead of: <s:taxonomy:categories>
Taxonomy::findByHandle('categories')

Navigation:

// Instead of: <s:nav:main>
Nav::find('main')->tree()

This would help developers transitioning from Antlers or building custom Blade components discover the most appropriate API for their needs.

Ngôn ngữ chính
PHP
Star
133
Fork
405
Merge trung bình
21 giờ 45 phút
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statamic/docs

Tất cả issue của statamic/docs

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.