Skip to content

Commit ffaf3d3

Browse files
committed
docs: do not show unrelated code in sample code
1 parent 31206da commit ffaf3d3

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

user_guide_src/source/tutorial/news_section.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ some additional tools to make working with data simpler. Add the
8888
following code to your model.
8989

9090
.. literalinclude:: news_section/002.php
91+
:lines: 11-18
9192

9293
With this code, you can perform two different queries. You can get all
9394
news records, or get a news item by its slug. You might have

user_guide_src/source/tutorial/news_section/002.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<?php
22

3+
namespace App\Models;
4+
5+
use CodeIgniter\Model;
6+
37
class NewsModel extends Model
48
{
9+
protected $table = 'news';
10+
511
public function getNews($slug = false)
612
{
713
if ($slug === false) {

0 commit comments

Comments
 (0)