Added: 2 years ago
From: Verbloten
Views: 43,895
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (36)

Sign In or Sign Up now to post a comment!
  • Hi, thanks for your series. I've begun working through them and have run into some early trouble. Is there anything in the 2.1.0 release that would affect this tutorial?

  • @JABevan Hi mate - yes there is... The way models and controllers are declared has changed slightly. Also the constructor is slightly different. Have a read of this codeigniter [dot] com/user_guide/installation/up­grade_200.html to see what you need to do differently...

  • @Verbloten Thanks man. I was able to make the updates; however, now I'm receiving the same error @lyndr29 received below:

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: User::$view_data

    Filename: controllers/user.php

    I've checked and checked my code, watched you previous tutorials, and can't seem to find the error.

  • @Verbloten

    I have this on line 9: $this->view_data['base_url'] = base_url();

    ...and this on line 21: $this->load->view('view_regist­er', $this->view_data);

  • @JABevan Dunno mate? You can shoot me through your code if you like and I will give it a once over... Send it to my email address or via the contact form on simplycodeigniter site

  • Excellet demonstration/tutorial!

  • I think it'd be great if you could put the version of CodeIgniter in the description so that things are a little bit future-proofed. I know that the video tutorials on the CI website are considered deprecated, but the lessons are still valid. Same could be said for you videos once CI has progressed further, I think.

    Thanks for the videos! Really great!

  • Hey, i'm trying to learn using Ci, but i have one problem Call to undefined function base_url() in MyHost/Ci/application/controll­ers/user.php on line 8

    ( i wrote url and form to autoload, but nothing changes ) Any ideas? :)

    And, thanks for the tutorials :)

  • @TheUfonautas Hi mate - sorry I missed your question sooner! You need to autoload the "url" helper.

    Rather than use $this->['base_url'] = base_url() in your constructor... I tend to just use base_url() when I need it now rather than sending it through to the view as a variable. Also see Gerrrrrrrry's comment below - you don't need it in anchor tags ie; echo anchor('controller/function', 'title', array('properties')) is sufficient...

  • @Verbloten Thank, thank, thank you!!

  • You can leave out the url helper and the setting of the base url as calling form_open without arguments will just set the action to blank which will make the form redirect to the same page.

  • @Gerrrry Setting the field value to black also seems to be done by default, so no need to set it in your code.

  • Hi, I'm new to CI and am just trying to follow this tutorial. I believe I did everything correct but I'm getting this message every time I click on the Register button:

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: User::$view_data

    Filename: controllers/user.php

    Line Number: 11

    There's also another notice, saying the 'base_url' is an undefined variable. Is there something I need to do to get rid of these 'notices'? Thanks much!

  • @lyndr29 Not sure what the problem is without seeing the source code. Contact me through simplycodeigniter website and I will reply. You can then email me your code. Otherwise - check that you have used $this->view_data['something'] = 'something'; before using it in the $this->load->view('view_name', $this->view_data)

    With base_url prob - use the function base_url() - not sure if I did in this tutorial as I used to assign a variable with the base_url. To use this you need the url helper loaded.

  • thanks for great tut.

  • @cnttlc No worries mate. Thanks for taking those few seconds to thank me :)

  • 2:04 Check your Security! :)

  • @mxcreations What do you mean?

  • Comment removed

  • @Verbloten its totally off topic... The windows security bubble pops up in your lower right corner ;)

    Awesome tutorial! Keep up the good work :)

  • Hi, great video series, thank you for sharing!

    What text editor are you using, and where can l get it?

  • @jslime Hi thanks! I use eclipse for php.. I think if you google php eclipse you should find it... I don't really understand eclipse btw! I use only a handful of it's features! I haven't looked around for better because it works OK. I does do some context sensitive help eg when you open a bracket on a function it will give you the options - if it knows the function. Sometimes it does this for CodeIgniter functions but I haven't figured out when it does and when it doesn't!

  • @jslime user netbeans, it's has great support for PHP code hinting and stuff.

  • hello can you tell me what is the base_url in config.php or the configuration in config.php..... thanks...

  • Great Series.....learned alot.

  • When doing the form_open if i point it to the base_url without directing it to the user controller and register function it works ok, but if I add the 'user/register' thing it throws up a file permissions error when i press submit. This is fine while user is my default controller, but I can't keep it that way. Is this a quick fix with a likley cause or are there millions of explanations.

  • hey mate.. not sure except perhaps you have not removed index.php using my other tutorial? try directing the form_open to 'index.php/user/register' or do yourself a favour and remove index.php refer my other tute.

    let me know if this was the problem?!

  • Why did you pass base_url in the view data and not just call base_url() in the view itself? Isn't that step redundant?

  • Hey mate

    I have no idea really.. Except I have always done it that way. No doubt I learnt that from someone else when I first started out. I guess you can do either. Normally I'll put the assignment of view_data['base_url'] into a base controller so it only has to be done once anyway - it's not that big a redundant step in that case...

  • Thanks to all that have commented and subscribed to my videos.

    I'd be happy to do more - just send me a message/leave a comment whatever with what you are interested in and I'll do up a vid tutorial for you.

  • great tutorials man, I am acutally learning CI now, so this is a great resource. Thanks!!

  • Congratulations Al, this is a great set of tutorials. I have never used CodeIgniter but am considering it and you have increased my confidence!

  • I think you need more quick launch icons.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more