Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-03-16 02:21:24

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 704

How is it that the "authors" tag is being parsed as a tag?

Perhaps I’m missing something simple, but I’m not finding aliasing for the authors tag. The class is clear and renderauthors makes sense; but how exactly the system parses the tag evades me. If classes can be rendered as tags as functions are it would lead to some interesting questions.

Offline

#2 2017-03-16 03:11:24

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: How is it that the "authors" tag is being parsed as a tag?

It’s in the tag registry (like any other tag), and resolved through it. I.e. the resolver gets the name of the tag being called by the parser and initializes the appropriate callback (whether function, method or my underpants). It all comes down to this:

Txp::get('\Textpattern\Tag\Registry')->register(array('\Textpattern\Tag\Syntax\Authors', 'renderAuthors'), 'authors');

Last edited by Gocom (2017-03-16 03:13:12)

Offline

#3 2017-03-16 04:27:05

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 704

Re: How is it that the "authors" tag is being parsed as a tag?

Thank you, that makes sense of it for me.

Offline

Board footer

Powered by FluxBB