Skip to content

Commit 73371c4

Browse files
committed
docs: update sample code
It is recommended to use BaseController instead of Controller.
1 parent d4db7b2 commit 73371c4

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

user_guide_src/source/tutorial/static_pages.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ code.
3939

4040
namespace App\Controllers;
4141

42-
use CodeIgniter\Controller;
43-
44-
class Pages extends Controller
42+
class Pages extends BaseController
4543
{
4644
public function index()
4745
{
@@ -66,7 +64,7 @@ displays the CodeIgniter welcome page.
6664
Both are *technically* a function. But when you create a function in a class,
6765
it's called a method.
6866

69-
The ``Pages`` class is extending the
67+
The ``Pages`` class is extending the ``BaseController`` class that extends the
7068
``CodeIgniter\Controller`` class. This means that the new Pages class can access the
7169
methods and variables defined in the ``CodeIgniter\Controller`` class
7270
(**system/Controller.php**).

0 commit comments

Comments
 (0)