Commits

Arie W. Subagja committed 48d6f32

add multiple attributes

  • Participants
  • Parent commits 15b9c35

Comments (0)

Files changed (1)

classes/malam/menu.php

         return $this->_items;
     }
 
-    public function add_attributes($key, $value)
+    public function add_attribute($key, $value)
     {
         if (! is_array($value))
             $value = exp(' ', $value);
         return $this;
     }
 
+    public function add_attributes(array $attributes)
+    {
+        foreach ($attributes as $key => $value)
+        {
+            $this->add_attribute($key, $value);
+        }
+
+        return $this;
+    }
+
     public function add($title, $url, array $attributes = NULL, array $children = NULL, array $params = NULL)
     {
         if (! ($url instanceof Route) && ! Valid::url($url) && ! in_array($url[0], array('/', '#')))