NYCPHP Meetup

NYPHP.org

[nycphp-talk] What UserLogin/Auth mechanism do you use ?

Chris Snyder csnyder at chxo.com
Sun Dec 14 12:32:28 EST 2003


David Mintz wrote:

>On Sat, 13 Dec 2003, Chris Snyder wrote:
>
>>n in-code example looks something like:
>>
>>$editcontrols = '';
>>if ( $auth->hasRole('calendar::editor') ) {
>>   $editcontrols = "<a href=\"$this->url?action=edit\">edit
>>$this->type</a>";
>>}
>>    
>>
>
>One (stupid?) question. Of what class is $this an instance?
>  
>

Doesn't matter for the example, it's a red herring and I should have 
used $obj or something.

But since you asked, that scheme is from an experiemental CMS named 
Berylium, which evals code and displays templates within the context of 
the object requested in the URL. In a Berylium template, $this refers to 
the requested object, be it directory, document, image, etc.

As confusing as it might be in a code example, it makes a lot of sense 
in context.





More information about the talk mailing list