diff --git a/user_guide_src/source/changelogs/v4.3.5.rst b/user_guide_src/source/changelogs/v4.3.5.rst index 5473f6b2c808..d1bc87ff17f5 100644 --- a/user_guide_src/source/changelogs/v4.3.5.rst +++ b/user_guide_src/source/changelogs/v4.3.5.rst @@ -18,12 +18,21 @@ Message Changes Changes ******* +- **make:cell** When creating a new cell, the controller would always have the ``Cell`` suffixed to the class name. + For the view file, the final ``_cell`` is always removed. +- **Cells** For compatibility with previous versions, view filenames ending with ``_cell`` can still be + located by the ``Cell`` as long as auto-detection of view file is enabled (via setting the ``$view`` property + to an empty string). + Deprecations ************ Bugs Fixed ********** +- **make:cell** Fixed generating view files as classes. +- **make:cell** Fixed treatment of single word class input for case-insensitive OS. + See the repo's `CHANGELOG.md `_ for a complete list of bugs fixed. diff --git a/user_guide_src/source/cli/cli_generators.rst b/user_guide_src/source/cli/cli_generators.rst index d66255bd1f18..b76fd06a6a98 100644 --- a/user_guide_src/source/cli/cli_generators.rst +++ b/user_guide_src/source/cli/cli_generators.rst @@ -59,12 +59,11 @@ Usage: Argument: ========= -* ``name``: The name of the cell class. It should be in PascalCase. +* ``name``: The name of the cell class. It should be in PascalCase. **[REQUIRED]** Options: ======== * ``--namespace``: Set the root namespace. Defaults to value of ``APP_NAMESPACE``. -* ``--suffix``: Append the component suffix to the generated class name. * ``--force``: Set this flag to overwrite existing files on destination. make:command diff --git a/user_guide_src/source/outgoing/view_cells.rst b/user_guide_src/source/outgoing/view_cells.rst index 7dad2b9878db..3aab107f9dff 100644 --- a/user_guide_src/source/outgoing/view_cells.rst +++ b/user_guide_src/source/outgoing/view_cells.rst @@ -80,7 +80,15 @@ Controlled Cells .. versionadded:: 4.3.0 -Controlled Cells have two primary goals: to make it as fast as possible to build the cell, and provide additional logic and flexibility to your views, if they need it. The class must extend ``CodeIgniter\View\Cells\Cell``. They should have a view file in the same folder. By convention the class name should be PascalCase and the view should be the snake_cased version of the class name. So, for example, if you have a ``MyCell`` class, the view file should be ``my_cell.php``. +Controlled cells have two primary goals: to make it as fast as possible to build the cell, and provide additional logic and +flexibility to your views, if they need it. The class must extend ``CodeIgniter\View\Cells\Cell``. They should have a view file +in the same folder. By convention, the class name should be in PascalCase suffixed with ``Cell`` and the view should be +the snake_cased version of the class name, without the suffix. For example, if you have a ``MyCell`` class, the view file +should be ``my.php``. + +.. note:: Prior to v4.3.5, the generated view file ends with ``_cell.php``. This was deemed incorrect and corrected accordingly. + For backward compatibility, existing view files ending with ``_cell.php`` will still be located and loaded. However, it is + recommended to update the filenames to remove the trailing ``_cell``. Creating a Controlled Cell ========================== @@ -99,7 +107,7 @@ At the most basic level, all you need to implement within the class are public p public $message; } - // app/Cells/alert_message_cell.php + // app/Cells/alert_message.php
@@ -199,7 +207,7 @@ If you need to perform additional logic for one or more properties you can use c } } - // app/Cells/alert_message_cell.php + // app/Cells/alert_message.php

type -

message -

@@ -230,7 +238,7 @@ Sometimes you need to perform additional logic for the view, but you don't want } } - // app/Cells/recent_posts_cell.php + // app/Cells/recent_posts.php