In CLinkColumn there's the very useful urlExpression and labelExpression. They are very useful since they are evaluated at runtime, in context of the specific record(=model object) handled at that iteration (when building a grid for example, with CGridView).
What I'm missing is the same dynamic capability for imageUrl property. I'm rendering an "articles" table where each article has its category. Categories are stored in another table and relationship is defined. Everything works fine with evaluation of "this" article's category name, which is used dynamically with labelExpression, but I cannot do the same for the category's icon. For that, I need this capability.
This thread is therefore to request such a feature: have something like imageUrlExpression that will be used in much the same way as labelExpression.
The task at hand looks simple enough so I'll do it and post here the outcome for your review.
Your comments are welcomed...
Boaz.
Page 1 of 1
Have imageUrlExpression in CLinkColumn introduce dynamic evaluation of imageUrl
#2
Posted 29 May 2012 - 06:22 AM
Attaching suggested improved CLinkColumn...
Attached File(s)
-
CLinkColumn.php (3.67K)
Number of downloads: 14
Therapeutic PHP sessions My LinkedIn Profile
#3
Posted 03 June 2012 - 05:51 AM
I've release this as an extension: http://www.yiiframew...n/pclinkbutton/
Therapeutic PHP sessions My LinkedIn Profile
#5
Posted 13 May 2013 - 07:18 AM
It may be an old topic but your extension saved me from some trouble.
Dynamic CLinkColumn image, dependent on the record's data in a grid,
this should definitely be part of the core framework.
A must have.
Many thanks.
Dynamic CLinkColumn image, dependent on the record's data in a grid,
this should definitely be part of the core framework.
A must have.
Many thanks.
#6
Posted 13 May 2013 - 07:21 AM
DavidD, on 13 May 2013 - 07:18 AM, said:
It may be an old topic but your extension saved me from some trouble.
Dynamic CLinkColumn image, dependent on the record's data in a grid,
this should definitely be part of the core framework.
A must have.
Many thanks.
Dynamic CLinkColumn image, dependent on the record's data in a grid,
this should definitely be part of the core framework.
A must have.
Many thanks.
Thanks for the feedback!
Therapeutic PHP sessions My LinkedIn Profile
Share this topic:
Page 1 of 1

Help














