Skip to content

Commit 4a65e2a

Browse files
committed
docs: add note for View Cells typed properties
1 parent dcbcf38 commit 4a65e2a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

user_guide_src/source/outgoing/view_cells.rst

+4
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ Implementing the AlertMessage from above as a Controlled Cell would look like th
101101

102102
.. literalinclude:: view_cells/010.php
103103

104+
.. note:: If you use typed properties, you must set the initial values:
105+
106+
.. literalinclude:: view_cells/023.php
107+
104108
.. _generating-cell-via-command:
105109

106110
Generating Cell via Command
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
// app/Cells/AlertMessageCell.php
4+
5+
namespace App\Cells;
6+
7+
use CodeIgniter\View\Cells\Cell;
8+
9+
class AlertMessageCell extends Cell
10+
{
11+
public string $type = '';
12+
public string $message = '';
13+
}

0 commit comments

Comments
 (0)