Playframework – play! How to retrieve the field values ​​in the template tag that are individually passed by the entity and field name as the parameter?

I want to create a tag, such as:

#{some_tag entity:user, field:'name'}< /pre> 

and hope it uses the following expression to generate some output with usernames:

${_entity._field}

I Know it doesn't work, but that's why I am asking here.
Is there an easy way to get the field value using the field name passed as a parameter to the template tag?

I don’t know a simple answer, but it is possible. You can create quick tags, And use reflection to get the fields you are after.
You can get more information about fast tags here – Can someone explain how to use FastTags

However, send specific fields Would it be easier to get to your mark?

I want to create a tag, such as:

#{some_tag entity:user, field:' name'}

and hope it uses the following expression to generate some output with usernames:

${_entity._field}

I know it doesn’t work, but that’s why I’m asking here.
Is there an easy way to get the field value using the field name passed as a parameter to the template tag?

I don’t know a simple answer, but it is possible. You can create a quick tag and use reflection to get the fields you are after. < br>You can get more information about fast tags here – Can someone explain how to use FastTags

But will it be easier to send specific fields to your tags?

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2705 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.