@@ -88,6 +88,7 @@ some additional tools to make working with data simpler. Add the
8888following code to your model.
8989
9090.. literalinclude :: news_section/002.php
91+ :lines: 11-18
9192
9293With this code, you can perform two different queries. You can get all
9394news records, or get a news item by its slug. You might have
@@ -113,7 +114,7 @@ a new ``News`` controller is defined. Create the new controller at
113114.. literalinclude :: news_section/003.php
114115
115116Looking at the code, you may see some similarity with the files we
116- created earlier. First, it extends a core CodeIgniter class, ``Controller ``,
117+ created earlier. First, it extends `` BaseController `` that extends a core CodeIgniter class, ``Controller ``,
117118which provides a couple of helper methods, and makes sure that you have
118119access to the current ``Request `` and ``Response `` objects, as well as the
119120``Logger `` class, for saving information to disk.
@@ -143,10 +144,10 @@ and add the next piece of code.
143144
144145.. literalinclude :: news_section/005.php
145146
146- .. note :: We are again using using `` esc()` ` to help prevent XSS attacks.
147+ .. note :: We are again using using :php:func:` esc()` to help prevent XSS attacks.
147148 But this time we also passed "url" as a second parameter. That's because
148149 attack patterns are different depending on the context in which the output
149- is used. You can read more about it :doc: ` here < /general/common_functions >`.
150+ is used.
150151
151152Here, each news item is looped and displayed to the user. You can see we
152153wrote our template in PHP mixed with HTML. If you prefer to use a template
0 commit comments