We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31206da commit ffaf3d3Copy full SHA for ffaf3d3
2 files changed
user_guide_src/source/tutorial/news_section.rst
@@ -88,6 +88,7 @@ some additional tools to make working with data simpler. Add the
88
following code to your model.
89
90
.. literalinclude:: news_section/002.php
91
+ :lines: 11-18
92
93
With this code, you can perform two different queries. You can get all
94
news records, or get a news item by its slug. You might have
user_guide_src/source/tutorial/news_section/002.php
@@ -1,7 +1,13 @@
1
<?php
2
3
+namespace App\Models;
4
+
5
+use CodeIgniter\Model;
6
7
class NewsModel extends Model
8
{
9
+ protected $table = 'news';
10
11
public function getNews($slug = false)
12
13
if ($slug === false) {
0 commit comments