Skip to content

Commit 44806d8

Browse files
committed
docs: improve explanation for "Calling a View Cell"
1 parent f057c17 commit 44806d8

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

user_guide_src/source/outgoing/view_cells.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ Calling a View Cell
2626

2727
No matter which type of View Cell you are using, you can call it from any view by using the ``view_cell()`` helper function.
2828

29-
The first parameter is the name of the class and method to call, and the second parameter is an array of parameters to pass to the method:
29+
The first parameter is (1) *the name of the class and method* (Simple Cell) or (2) *the name of the class* (Controlled Cell) to call,
30+
and the second parameter is an array of parameters to pass to the method:
3031

3132
.. literalinclude:: view_cells/001.php
3233

33-
The Cell method must return a string, which will be inserted into the view where the ``view_cell()`` function was called.
34+
The string that the Cell returns will be inserted into the view where the
35+
``view_cell()`` function was called.
3436

3537
Namespace Omission
3638
==================
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
// In a View.
2+
3+
// Simple Cell
24
<?= view_cell('App\Cells\MyClass::myMethod', ['param1' => 'value1', 'param2' => 'value2']) ?>
5+
6+
// Controlled Cell
7+
<?= view_cell('App\Cells\MyCell', ['param1' => 'value1', 'param2' => 'value2']) ?>

0 commit comments

Comments
 (0)