![]() |
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
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 )
(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.
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 ![]() Missing that in Tutorial or not seen
06-18-2025, 09:31 PM
(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 )
(06-18-2025, 09:31 PM)InsiteFX Wrote: Get use to it, it's used in almost all Controllers, Libraries and Models Yes, fundamental knowledge, just learned that. Thank you for fast Support and help !! Nice ! |
Welcome Guest, Not a member yet? Register Sign In |