Welcome Guest, Not a member yet? Register   Sign In
Confusing name of view()-method in the tutorial
#3

(This post was last modified: 04-11-2017, 03:01 PM by PaulD.)

Hi sponti,

Good luck with teaching CI. It is a fabulous framework and really easy to get going with.

(04-10-2017, 04:44 AM)sponti Wrote: - There is no really "Hello World" example
The 'Hello World' page is really the default page that is displayed when you first load CI. You can see the Welcome controller calling the welcome_view.

(04-10-2017, 04:44 AM)sponti Wrote: - In the "Static Page"-Example there is a method named "view()" in the CI_Controller Class.
This is very confusing for students who are new in the MVC world, because at the beginning it's very hard to understand the difference between controllers, Models and views (and to call the methods belonging to it)
I think you are absolutely right here. A simple change to the example and this possible source of confusion could be removed. It could easily be

PHP Code:
<?php
class Pages extends CI_Controller {

        public function 
display_page($page 'home')
        {
        }

As seen here in the tutorial as method 'view': https://www.codeigniter.com/user_guide/t...pages.html

In fact, perhaps it would also be a good idea to call the default controller 'Hello_world' and default view 'hello_world_view'.

So just wanted to say I agree with you and I hope you enjoy CI as much as we all do. The documentation is pretty spectacular when you get into it, but as always, is a labour of love by dedicated volunteers.

Best wishes,

Paul.
Reply


Messages In This Thread
RE: Confusing name of view()-method in the tutorial - by PaulD - 04-11-2017, 02:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB