Skip to content

Commit 34921be

Browse files
committed
docs: improve sample code
1 parent a74db61 commit 34921be

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

user_guide_src/source/outgoing/view_cells.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ You would call it from within a view like:
5858
Additionally, you can use parameter names that match the parameter variables in the method for better readability.
5959
When you use it this way, all of the parameters must always be specified in the view cell call::
6060

61-
<?= view_cell('\App\Libraries\Blog::recentPosts', 'category=codeigniter, limit=5') ?>
61+
// In a View.
62+
<?= view_cell('Blog::recentPosts', 'category=codeigniter, limit=5') ?>
6263

64+
// In a Cell.
6365
public function recentPosts(string $category, int $limit)
6466
{
6567
$posts = $this->blogModel->where('category', $category)

0 commit comments

Comments
 (0)