Welcome Guest, Not a member yet? Register   Sign In
Bugs in Tutorial CI4
#1

Hi CodeIgniter Team,
just started learning Codeigniter and doing step by step your Tutorial.
In:
https://codeigniter.com/user_guide/tutor...how-method
In Controller also in Method you use show instead of view and that doesn't work, it should be named to view
Should be changed in Routing "Routes.php", in Controller "News.php"
it was mixed with view and show
Reply
#2

The show method is right it is looking up and checking the page slug.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(06-17-2025, 09:03 PM)InsiteFX Wrote: The show method is right it is looking up and checking the page slug.
And now I don’t really know why I said that, or why it only worked for me after I renamed the method to view both in the router and in the controller. Because now I’ve changed it back to match the tutorial, and it works just fine — which actually makes sense.

So, no bug after all — the tutorial is perfect.

What did make me a bit unsure, though, was this:
https://github.com/numbrCode/codeigniter.../tree/main
because here, it was also renamed to view.
Reply
#4

(This post was last modified: 06-18-2025, 07:58 AM by michel42.)

hmm, when I want to Route '/' to welcome_message, I use in Routes "$routes->get('/', 'Home::index');"
But then it always crashes when I use methode save in "news/new" View
If I remove "$routes->get('/', 'Home::index');" like in Tutorial, what do I need to add to Routes to load welcome_message as default for "/"

Sorry, I'm very Newbie

got it !!
in routes I added
use App\Controllers\Home;
that's it Smile
Missing that in Tutorial or not seen
Reply
#5

(This post was last modified: 06-18-2025, 09:32 PM by InsiteFX. Edit Reason: spelling error )

Get use to it, it's used in almost all Controllers, Libraries and Models
when accessing other Libraries and Models to tell it were the namespace is.

PHP.net - Using namespaces: Aliasing/Importing
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

(This post was last modified: 06-19-2025, 12:14 AM by michel42.)

(06-18-2025, 09:31 PM)InsiteFX Wrote: Get use to it, it's used in almost all Controllers, Libraries and Models
when accessing other Libraries and Models to tell it were the namespace is.

PHP.net - Using namespaces: Aliasing/Importing

Yes, fundamental knowledge, just learned that.
Thank you  for fast Support and help !! Nice !
Reply




Theme © iAndrew 2016 - Forum software by © MyBB