What is the $c variable for?
Permalink
I notice the $c variable is used often. Is it the same variable globally? What exactly does the $c variable point to / do ???
Some code to more understand the $c:
Example-1: If current page is in edit mode:
Example-2: prints area to the object $c:
Also its very handy to understand what is this "->" arrow and some OOP basics:
"he use of the arrow (->) is an OOP construct that accesses the contained properties and methods of a given object."
See the full tutorial her:
http://code.tutsplus.com/tutorials/object-oriented-php-for-beginner...
Example-1: If current page is in edit mode:
if ($c->isEditMode()) { echo 'You are editing this page'; }
Example-2: prints area to the object $c:
$areaSidebar = new Area('Sidebar'); $areaSidebar->display($c);
Also its very handy to understand what is this "->" arrow and some OOP basics:
"he use of the arrow (->) is an OOP construct that accesses the contained properties and methods of a given object."
See the full tutorial her:
http://code.tutsplus.com/tutorials/object-oriented-php-for-beginner...
Hi ob7dev,
I recommend reviewing the documentation on pages.
http://documentation.concrete5.org/developers/working-with-pages/ov...
I recommend reviewing the documentation on pages.
http://documentation.concrete5.org/developers/working-with-pages/ov...
You can do stuff like:
It is not available in *every* php file. If the object is not available, you can retrieve it with: