CodeIgniter Forums
Bugs in Tutorial CI4 - 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: Bugs in Tutorial CI4 (/showthread.php?tid=93033)



Bugs in Tutorial CI4 - michel42 - 06-17-2025

Hi CodeIgniter Team,
just started learning Codeigniter and doing step by step your Tutorial.
In:
https://codeigniter.com/user_guide/tutorial/news_section.html#complete-news-show-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


RE: Bugs in Tutorial CI4 - InsiteFX - 06-17-2025

The show method is right it is looking up and checking the page slug.


RE: Bugs in Tutorial CI4 - michel42 - 06-18-2025

(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/codeigniter4-build-your-first-application/tree/main
because here, it was also renamed to view.


RE: Bugs in Tutorial CI4 - michel42 - 06-18-2025

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


RE: Bugs in Tutorial CI4 - InsiteFX - 06-18-2025

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


RE: Bugs in Tutorial CI4 - michel42 - 06-19-2025

(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 !