Skip to content

Commit da06727

Browse files
committed
docs: add sub section titles, etc.
1 parent 73aded6 commit da06727

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

user_guide_src/source/outgoing/view_cells.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,27 @@ CodeIgniter supports two types of View Cells: simple and controlled. Simple View
1616
Calling a View Cell
1717
*******************
1818

19-
No matter which type of View Cell you are using, you can call it from any view by using the ``view_cell()`` helper method. 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. The method must return a string, which will be inserted into the view where the ``view_cell()`` method was called.
19+
No matter which type of View Cell you are using, you can call it from any view by using the ``view_cell()`` helper function.
20+
21+
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.
2022
::
2123

2224
<?= view_cell('App\Cells\MyClass::myMethod', ['param1' => 'value1', 'param2' => 'value2']) ?>
2325

24-
If you do not include the full namespace for the class, it will assume in can be found in the ``App\Cells`` namespace. So, the following example would attempt to find the ``MyClass`` class in ``app/Cells/MyClass.php``. If it is not found there, all namespaces will be scanned until it is found, searching within a ``Cells`` subdirectory of each namespace.
26+
The Cell method must return a string, which will be inserted into the view where the ``view_cell()`` function was called.
27+
28+
Namespace Omission
29+
==================
30+
31+
.. versionadded:: 4.3.0
32+
33+
If you do not include the full namespace for the class, it will assume in can be found in the ``App\Cells`` namespace. So, the following example would attempt to find the ``MyClass`` class in **app/Cells/MyClass.php**. If it is not found there, all namespaces will be scanned until it is found, searching within a **Cells** subdirectory of each namespace.
2534
::
2635

2736
<?= view_cell('MyClass::myMethod', ['param1' => 'value1', 'param2' => 'value2']) ?>
2837

29-
.. note:: Namespace omission is available since v4.3.0 and later.
38+
Passing Parameters as Key/Value String
39+
======================================
3040

3141
You can also pass the parameters along as a key/value string:
3242
::

0 commit comments

Comments
 (0)