Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Language Helper: Add optional class variable to label. In addition, rem... #1235

Closed
wants to merge 8 commits into
from

Conversation

Projects
None yet
3 participants

jcc2010 commented Apr 1, 2012

...ove the empty check for ID, instead set to NULL.

@jcc2010 jcc2010 Language Helper: Add optional class variable to label. In addition, r…
…emove the empty check for ID, instead set to NULL.
7a1f3f7

jcc2010 commented Apr 1, 2012

Very small and simple change. Allows the language helper to add a class to the label, but only if one is explicitly called. Also changed the condition off !='' on the ID to instead force a NULL.

@philsturgeon philsturgeon commented on an outdated diff Apr 4, 2012

system/helpers/language_helper.php
{
$CI =& get_instance();
$line = $CI->lang->line($line);
- if ($id != '')
+ if ( $id && !$class )
@philsturgeon

philsturgeon Apr 4, 2012

Contributor

Can you remove the spaces between code and brackets please.

if ($id && ! $class)
Contributor

philsturgeon commented Apr 4, 2012

This will need to be documented before we can add this into the develop branch, and it will need to be listed ion the changelog too.

@narfbg narfbg commented on an outdated diff Apr 4, 2012

system/helpers/language_helper.php
{
- $line = '<label for="'.$id.'">'.$line.'</label>';
+ $line = '<label for="'.$id.'">'.$line."</label>";
@narfbg

narfbg Apr 4, 2012

Contributor

Why is this line changed?

jcc2010 commented Apr 5, 2012

I believe I have added the requested changes. If further are needed, let me know.

@narfbg narfbg commented on the diff Jun 14, 2012

system/language/english/migration_lang.php
@@ -30,7 +30,11 @@
$lang['migration_multiple_version'] = "This are multiple migrations with the same version number: %d.";
$lang['migration_class_doesnt_exist'] = "The migration class \"%s\" could not be found.";
$lang['migration_missing_up_method'] = "The migration class \"%s\" is missing an 'up' method.";
+<<<<<<< HEAD
@narfbg

narfbg Jun 14, 2012

Contributor

Um ... that's not right.

Contributor

narfbg commented Jun 14, 2012

Btw, just an idea - could we change the $id parameter to accept an array of attributes as well?
By default it can still interpret non-arrays as the id, but we can deprecate that and encourage everybody to use it like this:

lang($line, array('id' => 'my_id', 'class' => 'my_class', 'other_attribute' => 'my_value');

@narfbg narfbg added a commit that referenced this pull request Nov 26, 2012

@narfbg narfbg Language helper lang() to accept optional HTML attributes
(an improved version of PR #1235)
3b40706
Contributor

narfbg commented Nov 26, 2012

See the above commit.

@narfbg narfbg closed this Nov 26, 2012

@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this pull request Jun 29, 2013

@narfbg narfbg Language helper lang() to accept optional HTML attributes
(an improved version of PR #1235)
fdcaacb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment