Пример #1
0
 public function testJsonFormat()
 {
     $input = 'formats.jsontest.json';
     $expected = $this->_data['formats']['jsontest'];
     $result = StaticContents::get($input, $this->options);
     $this->assertEqual($expected, $result);
 }
Пример #2
0
 public static function find(array $options = array())
 {
     $defaults = array('collect' => true);
     $options += $defaults;
     $data = array();
     $libs = Libraries::get(null, 'path');
     $recursive = true;
     foreach ($libs as $lib => $path) {
         $result = array();
         $path .= '/views/widgets';
         $files = StaticContents::available(compact('path', 'recursive'));
         if (!$files) {
             continue;
         }
         $temp = array_keys(Set::flatten($files, array('separator' => '/')));
         foreach ($temp as $key => $value) {
             if (strpos($value, 'admin.') !== false) {
                 continue;
             }
             if (strpos($value, 'inc.') !== false) {
                 continue;
             }
             $result[$key] = str_replace('.html.php', '', $value);
         }
         $data[$lib] = $result;
     }
     return $data;
 }