Exemplo n.º 1
0
 /**
  * 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;
     }
 }
Exemplo n.º 2
0
 /**
  * @covers Fuel\Common\Html::arrayToAttributes
  * @group Common
  */
 public function testTagWithAttributesThatNeedEncoding()
 {
     $this->assertEquals('name="blue & green"', Html::arrayToAttributes(array('name' => 'blue & green')));
 }