Пример #1
0
 function createWidget($owner, $className, $properties = array())
 {
     $className = Monc::importlib($className, true);
     $widget = new $className($owner);
     if (isset($this->widgets[$className])) {
         $properties = $properties === array() ? $this->widgets[$className] : MMap::mergeArray($this->widgets[$className], $properties);
     }
     foreach ($properties as $name => $value) {
         $widget->{$name} = $value;
     }
     return $widget;
 }
Пример #2
0
 static function pagination(array $items, $htmlOptions = array())
 {
     if (!empty($items)) {
         $htmlOptions = self::addCssClass('pagination', $htmlOptions);
         $output = self::openTag('ul', $htmlOptions);
         foreach ($items as $itemOptions) {
             $options = MMap::getValue($itemOptions, 'htmlOptions', array());
             if (!empty($options)) {
                 $itemOptions = MMap::mergeArray($options, $itemOptions);
             }
             $label = MMap::getValue($itemOptions, 'label', '');
             $url = MMap::getValue($itemOptions, 'url', false);
             $output .= self::paginationLink($label, $url, $itemOptions);
         }
         $output .= '</ul>';
         return $output;
     }
     return '';
 }
Пример #3
-1
<?php

$main = (require dirname(__FILE__) . DS . '..' . DS . "main.php");
return MMap::mergeArray($main, array('db' => array('dsn' => 'mysql:host=localhost;dbname=monc-php', 'user' => 'root', 'password' => '123', 'charset' => 'utf-8')));
Пример #4
-1
<?php

$main = (require dirname(__FILE__) . DS . '..' . DS . "main.php");
return MMap::mergeArray($main, array('db' => array('dsn' => 'mysql:host=[hostname];dbname=[dbname]', 'user' => '[user]', 'password' => '[pwd]', 'charset' => 'utf-8')));