Add practical examples showing facade alternatives to Antlers tags
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ệ
- 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:
- Antlers Blade Components (
<s:glide>) - verbose for simple use cases - 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của statamic/docs
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Chunked UploadsĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Installation / Deployment Guides
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 40/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Document how conditions treat empty and null valuesCó thể đã có người làm @joshdaugherty đã nhận 15 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của statamic/docs
Issue tương tự
-
HttpRequestTrait fatals on WordPress 7.2: $blocked_http_requests clashes with WP_UnitTestCase_BaseĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pluginsGLPI/addressing#127 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
WordPress/create-block-theme#886 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
humanmade/hm-popup-block#18 ·