Welcome Guest, Not a member yet? Register   Sign In
Build Your First Application » Static Pages (CI 4.2.1)
#1

Today (2022-07-27), I'm reproducing https://codeigniter.com/user_guide/tutor...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
Reply
#2

(This post was last modified: 07-27-2022, 11:58 AM by luckmoshy.)

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
Do Codeigniter Before Do You!
yekrinaDigitals

Reply
#3

Thank you for explanation.

Your steps (https://codeigniter.com/user_guide/tutor...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!
Reply
#4

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

I sent a PR to fix:
https://github.com/codeigniter4/CodeIgni...6304/files
Reply




Theme © iAndrew 2016 - Forum software by © MyBB