/** * Helper function to convert an array into a list of attributes and append * them to a string * * @param string $html * @param array $attributes */ protected function addAttributes(&$html, array $attributes) { if (count($attributes) > 0) { $attributes = Html::arrayToAttributes($attributes); $html .= ' ' . $attributes; } }
/** * @covers Fuel\Common\Html::arrayToAttributes * @group Common */ public function testTagWithAttributesThatNeedEncoding() { $this->assertEquals('name="blue & green"', Html::arrayToAttributes(array('name' => 'blue & green'))); }