Welcome Guest, Not a member yet? Register   Sign In
What are the difference between $this->data->total_pages and $data['total_pages']
#2

[eluser]danmontgomery[/eluser]
$this is the object in the context that it's being called used (as in "this" instance of the class), and you can only use $this in object methods.

Code:
class blog_object {
  function print_data(){
    echo $this->title . "<br/>";
    echo $this->body . "<br/>";
    echo $this->author . "<br/>";
  }
}

$blog = new blog_object;
$blog->title = "A Blog";
$blog->body = "This is the text of a blog";
$blog->author = "Me";
$blog->print_data();

http://php.net/manual/en/language.oop5.php


Messages In This Thread
What are the difference between $this->data->total_pages and $data['total_pages'] - by El Forum - 01-20-2010, 02:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB