Skip to content

Commit

Permalink
2.0.1 - icons
Browse files Browse the repository at this point in the history
Fixes #34
  • Loading branch information
brandonkelly committed Mar 8, 2024
1 parent aa90ce2 commit 84974a4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft Generator

## 2.0.1 - 2024-03-08
- Generated field types, utilities, and widget types now provide default icons.
- Fixed an error that occurred when generating a utility. ([#34](https://github.com/craftcms/generator/issues/34))

## 2.0.0 - 2024-03-06
- Craft Generator now requires Craft 5.
- Renamed `craft\generator\Command\EVENT_REGISTER_GENERATOR_TYPES` to `EVENT_REGISTER_GENERATORS`.
Expand Down
1 change: 1 addition & 0 deletions src/generators/FieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private function methods(): array

return [
'displayName' => sprintf('return %s;', $this->messagePhp($this->displayName)),
'icon' => 'return \'i-cursor\';',
'phpType' => "return 'mixed';",
'dbType' => <<<PHP
// Replace with the appropriate data type this field will store in the database,
Expand Down
2 changes: 1 addition & 1 deletion src/generators/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private function methods(): array
return [
'displayName' => sprintf('return %s;', $this->messagePhp($this->displayName)),
'id' => "return '$this->utilityId';",
'iconPath' => 'return null;',
'icon' => 'return \'wrench\';',
'contentHtml' => <<<PHP
// todo: replace with custom content HTML
return '';
Expand Down
2 changes: 1 addition & 1 deletion src/generators/WidgetType.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function methods(): array
return [
'displayName' => sprintf('return %s;', $this->messagePhp($this->displayName)),
'isSelectable' => 'return true;',
'icon' => 'return null;',
'icon' => 'return \'chart-line\';',
'getBodyHtml' => <<<PHP
// todo: replace with custom body HTML
return '';
Expand Down

0 comments on commit 84974a4

Please sign in to comment.