I have a shopping cart that is written oldschool (procedural) style PHP and I am trying to convert it to OOP PHP and learning as I go. Anyone interested in giving me a few pointers?
For example:
Code:<?php class Pagination { var $numrows; var $rowsperpage; var $totalpages; function SetPagination () { $this->numrows = 50; $this->rowsperpage = 12; $this->totalpages = ceil($this->numrows / $this->rowsperpage); } } ?>why does $totalrows echo null?Code:<?php $page = new Pagination(); $page->SetPagination(); echo "numrows: " . $page->numrows . "<br />"; echo "rowsperpage: " . $page->rowsperpage . "<br />"; echo "totalrows: " . $page->totalrows; ?>





Bookmarks