Skip to content

Instantly share code, notes, and snippets.

@Palleas
Created January 8, 2010 13:21
Show Gist options
  • Save Palleas/272044 to your computer and use it in GitHub Desktop.
Save Palleas/272044 to your computer and use it in GitHub Desktop.
<?php
/**
*
*/
class noeWidgetFormTextarea extends sfWidgetFormTextarea
{
const CUSTOM_ATTRIBUTES_KEY = 'fieldAttributes';
public function render($name, $value = null, $attributes = array(), $errors = array())
{
if ($this->hasCustomFieldAttributes())
{
$this->setAttribute('class', 'use_tinyMCE');
}
return parent::render($name, $value, $attributes, $errors);
}
protected function hasCustomFieldAttributes()
{
return !is_null($this->getAttribute(self::CUSTOM_ATTRIBUTES_KEY));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment