Codeigniter how to access class variables
Posted
by Obay
on Stack Overflow
See other posts from Stack Overflow
or by Obay
Published on 2010-06-12T14:19:59Z
Indexed on
2010/06/12
14:22 UTC
Read the original article
Hit count: 306
codeigniter
|classes
I thought this was going to be a no-brainer but I can't seem to access member variables:
class MyObject extends Controller {
private $START_OF_WEEK = 1;
/* constructor here */
function index() {
echo $this->$START_OF_WEEK;
}
}
echo $this->$START_OF_WEEK;
says Cannot access empty property
How do I access member variables? Or... how do I declare them correctly?
© Stack Overflow or respective owner