From 22b8f36b4a07af2f72429eed4e57b24b0f937634 Mon Sep 17 00:00:00 2001
From: WebVPF <61043464+WebVPF@users.noreply.github.com>
Date: Mon, 21 Oct 2024 10:56:52 +0300
Subject: [PATCH 1/4] Fixed controller file extension from htm to php (#217)
---
backend/lists.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/backend/lists.md b/backend/lists.md
index 05d03c3c..8a98091a 100644
--- a/backend/lists.md
+++ b/backend/lists.md
@@ -91,7 +91,7 @@ The toolbar configuration allows:
Option | Description
------------- | -------------
-`buttons` | a reference to a controller partial file with the toolbar buttons. Eg: **_list_toolbar.htm**
+`buttons` | a reference to a controller partial file with the toolbar buttons. Eg: **_list_toolbar.php**
`search` | reference to a Search Widget configuration file, or an array with configuration.
The search configuration supports the following options:
@@ -441,7 +441,7 @@ group_id:
content:
label: Content
type: partial
- path: ~/plugins/acme/blog/models/comment/_content_column.htm
+ path: ~/plugins/acme/blog/models/comment/_content_column.php
```
### Color Picker
@@ -828,7 +828,7 @@ public function index()
### Overriding views
-The `ListController` behavior has a main container view that you may override by creating a special file named `_list_container.htm` in your controller directory. The following example will add a sidebar to the list:
+The `ListController` behavior has a main container view that you may override by creating a special file named `_list_container.php` in your controller directory. The following example will add a sidebar to the list:
```html
@@ -858,7 +858,7 @@ customViewPath: $/acme/blog/controllers/reviews/list
> **NOTE**: It is a good idea to use a sub-directory, for example `list`, to avoid conflicts.
-For example, to modify the list body row markup, create a file called `list/_list_body_row.htm` in your controller directory.
+For example, to modify the list body row markup, create a file called `list/_list_body_row.php` in your controller directory.
```php
From 5284353843d4a7dbb7e597081fbed064e37ba7f4 Mon Sep 17 00:00:00 2001
From: WebVPF <61043464+WebVPF@users.noreply.github.com>
Date: Thu, 31 Oct 2024 02:31:14 +0200
Subject: [PATCH 2/4] Fixed code language (#218)
---
backend/lists.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/lists.md b/backend/lists.md
index 8a98091a..9537d0cc 100644
--- a/backend/lists.md
+++ b/backend/lists.md
@@ -830,7 +830,7 @@ public function index()
The `ListController` behavior has a main container view that you may override by creating a special file named `_list_container.php` in your controller directory. The following example will add a sidebar to the list:
-```html
+```php
= $toolbar->render() ?>
From 5367b4bb853d3436a90987524ad53828902710dc Mon Sep 17 00:00:00 2001
From: WebVPF <61043464+WebVPF@users.noreply.github.com>
Date: Mon, 4 Nov 2024 08:16:21 +0200
Subject: [PATCH 3/4] Fix code style (#219)
---
database/attachments.md | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/database/attachments.md b/database/attachments.md
index f9388e4b..6eeb4883 100644
--- a/database/attachments.md
+++ b/database/attachments.md
@@ -16,7 +16,7 @@ A single file attachment:
```php
public $attachOne = [
- 'avatar' => 'System\Models\File'
+ 'avatar' => \System\Models\File::class,
];
```
@@ -24,7 +24,7 @@ Multiple file attachments:
```php
public $attachMany = [
- 'photos' => 'System\Models\File'
+ 'photos' => \System\Models\File::class,
];
```
@@ -34,7 +34,10 @@ Protected attachments are uploaded to the File Upload disk's **uploads/protected
```php
public $attachOne = [
- 'avatar' => ['System\Models\File', 'public' => false]
+ 'avatar' => [
+ \System\Models\File::class,
+ 'public' => false,
+ ],
];
```
@@ -137,14 +140,14 @@ Inside your model define a relationship to the `System\Models\File` class, for e
class Post extends Model
{
public $attachOne = [
- 'featured_image' => 'System\Models\File'
+ 'featured_image' => \System\Models\File::class,
];
}
```
Build a form for uploading a file:
-```html
+```php
= Form::open(['files' => true]) ?>
@@ -184,16 +187,18 @@ if ($fileFromPost) {
Display the uploaded file on a page:
```php
-// Find the Blog Post model again
-$post = Post::find(1);
+featured_image) {
- $featuredImage = $post->featured_image->getPath();
-}
-else {
- $featuredImage = 'http://placehold.it/220x300';
-}
+ // Look for the featured image address, otherwise use a default one
+ if ($post->featured_image) {
+ $featuredImage = $post->featured_image->getPath();
+ }
+ else {
+ $featuredImage = 'http://placehold.it/220x300';
+ }
+?>
```
From ad09d0641762a36344acedc750669e660f1e5e29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ali=20Sara=C3=A7o=C4=9Flu?=
Date: Sat, 16 Nov 2024 12:17:42 +0300
Subject: [PATCH 4/4] Fix incorrect parameter name (#220)
---
cms/pages.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cms/pages.md b/cms/pages.md
index 779cf619..f2f83d58 100644
--- a/cms/pages.md
+++ b/cms/pages.md
@@ -20,7 +20,7 @@ Parameter | Description
`title` | the page title, required.
`layout` | the page [layout](layouts), optional. If specified, should contain the name of the layout file, without extension, for example: `default`.
`description` | the page description for the backend interface, optional.
-`hidden` | hidden pages are accessible only by logged-in backend users, optional.
+`is_hidden` | hidden pages are accessible only by logged-in backend users, optional.
### URL syntax