CodeIgniter Forums
Build Your First Application » Static Pages (CI 4.2.1) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Build Your First Application » Static Pages (CI 4.2.1) (/showthread.php?tid=82587)



Build Your First Application » Static Pages (CI 4.2.1) - rodrigoguariento - 07-27-2022

Today (2022-07-27), I'm reproducing https://codeigniter.com/user_guide/tutorial/static_pages.html steps, but at the session "You can now try several URLs in the browser location field, to see what the Pages controller you made above produces…" (at bottom) the following URL (column) on the table doesn't produces the Will show (column):
[Image: Untitled.png]
[Image: Untitled2.png]
[Image: Untitled-A.png]
[Image: Untitled-B.png]
[Image: Untitled-C.png]
[Image: Untitled-D.png]
[Image: Untitled-E.png]
[Image: Untitled-z.png]

I'm using CodeIgniter Version 4.2.1, PHP Version 7.4.30, PHP SAPI cli-server, Environment development, Base URL http://localhost:8080/, ... started with: $ php spark serve

Any suggestion? Thanks.
development


RE: Build Your First Application » Static Pages (CI 4.2.1) - luckmoshy - 07-27-2022

Shortly you should learn how CI wild route
PHP Code:
$routes->get('(:any)''Pages::view/$1'); 
work you have done right except you should remove
Code:
(pages/view)
in your URL parameter and leave
Code:
localhost:8080/home
then it will work. the above CI 4 methods are for teaching only so making it easy to be understandable


RE: Build Your First Application » Static Pages (CI 4.2.1) - rodrigoguariento - 07-27-2022

Thank you for explanation.

Your steps (https://codeigniter.com/user_guide/tutorial/static_pages.html) are working now with the code:

PHP Code:
$routes->get('pages/(:any)''Pages::view/$1'); 


... instead of:

PHP Code:
$routes->get('(:any)''Pages::view/$1'); 


Now I understood. Thanks!


RE: Build Your First Application » Static Pages (CI 4.2.1) - kenjis - 07-27-2022

Thanks for reporting.
It appears that previous updates caused an inconsistency in the documentation.

I sent a PR to fix:
https://github.com/codeigniter4/CodeIgniter4/pull/6304/files