Yii Framework Forum: Add 'title' tags to CHtml linkTag and image methods of CHtml.php - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Add 'title' tags to CHtml linkTag and image methods of CHtml.php Rate Topic: -----

#1 User is offline   jbr 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 07-February 09

Posted 07 February 2009 - 10:06 PM

All generated hyperlinks and images need the title attributed added.
Titles are not decoration (providing "tool tips" is a side-effect).

They are required DOM elements and help sites conform with the W3C WAI-aaa and Section 508 standard -- most automated validators miss title when the DOC Type is "transitional."

One of the benefits of including title is that screen readers can read these to the sight-impaired and they can be useful to those stuck on mobile devices.

For example:
<a href="http://www.yiiframework.com/">Yii Framework</a>
should be:
<a title="Yii Framework" href="http://www.yiiframework.com/">Yii Framework</a>

public static function linkTag( . . . , $title, . . .)
public static function image  ( . . . , $title, . . .)

Description
CHtml is a static class that provides a collection of helper methods
for creating HTML views.

Location
. . . /yii/framework/web/helpers/CHtml.php

0

#2 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,899
  • Joined: 04-October 08
  • Location:DC, USA

Posted 08 February 2009 - 10:59 AM

You can specify a title by passing a 'title' element in the html option parameter. We are not going to change the methods with the new title parameter because it would break backward compatibility.
0

#3 User is offline   jbr 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 07-February 09

Posted 08 February 2009 - 11:28 AM

Thanks for reminding me about the flexibility of Yii.  Of course I can add the 'title' attribute using htmloptions, and I will; I also appreciate the necessity for maintaining backward compatibility.
0

#4 User is offline   kinetic_one 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 04-May 09

Posted 16 April 2012 - 03:41 PM

Hello,

I read your post. I'm also interested in the screen reader part.
The title-tag part seems something that can be done, but what about things like the search/filter boxes on top of a datagrid view, along with the buttons on the right and?
When I try to tab through a bacis Yii app, nothing gets selected except for a few menu items.
Do you perhaps know a solutions?

View Postjbr, on 07 February 2009 - 10:06 PM, said:

All generated hyperlinks and images need the title attributed added.
Titles are not decoration (providing "tool tips" is a side-effect).

They are required DOM elements and help sites conform with the W3C WAI-aaa and Section 508 standard -- most automated validators miss title when the DOC Type is "transitional."

One of the benefits of including title is that screen readers can read these to the sight-impaired and they can be useful to those stuck on mobile devices.

For example:
<a href="http://www.yiiframework.com/">Yii Framework</a>
should be:
<a title="Yii Framework" href="http://www.yiiframework.com/">Yii Framework</a>

public static function linkTag( . . . , $title, . . .)
public static function imageĀ  ( . . . , $title, . . .)

Description
CHtml is a static class that provides a collection of helper methods
for creating HTML views.

Location
. . . /yii/framework/web/helpers/CHtml.php

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users