$page->getAttribute() $cobj->getCollectionAttributeValue()

Permalink
Hi,

Just a quick one that i dont understand what are the different ways to pull in an attribute from a page and when should they be used?

I am using

$page->getAttribute()
$cobj->getCollectionAttributeValue()
$c->getAttribute()

can someone shed some light?

TMDesigns
 
enlil replied on at Permalink Reply
enlil
Just a matter of what variable is used in that instance for the page collection, whether page cobj or c is used.
mhawke replied on at Permalink Reply
mhawke
Is there a reason why a developer would use one variable over the other? In the core code, "$c = Page::..." is used a lot but "$cobj = Page::..." is NEVER used. Do they represent different 'collections' or is it just semantics?
TMDesigns replied on at Permalink Reply
TMDesigns
I Was more interested in the difference between

getAttribute()
getCollectionAttributeValue()
mhawke replied on at Permalink Reply
mhawke
Curiosity or a specific problem?

Have a look at the code. Line 123 of [root]/concrete/core/models/collection.php
TMDesigns replied on at Permalink Reply
TMDesigns
Just curiosity