Exemplo n.º 1
0
     }
     fclose($file);
     return $r;
 }, 'this' => function () {
     return PheryResponse::factory()->this->css(array('backgroundColor' => '#000', 'color' => '#fff'))->parent()->append('<p>Nice!</p>');
 }, 'dumpvars' => function ($data) {
     $r = new PheryResponse();
     $d = array();
     $d['dummy_info'] = 'dummy to show in print/dump';
     foreach ($data as $name => $value) {
         if ($name !== 'is_print') {
             $d[$name] = $value;
         }
     }
     if (!empty($data['is_print'])) {
         $r->print_vars($d);
     } else {
         $r->dump_vars($d);
     }
     return $r->this->phery('append_args', array('wow' => 'true'));
 }, 'test' => array($instance, 'test'), 'test2' => 'test', 'test4' => array('myClass', 'test2'), 'test5' => function () {
     return PheryResponse::factory()->redirect('http://www.google.com');
 }, 'data' => array($instance, 'data'), 'trigger' => 'trigger', 'form' => 'form', 'thisone' => 'thisone', 'surprise' => function ($data) {
     return PheryResponse::factory()->call(array('location', 'reload'), true);
 }, 'invalid' => function () {
     return PheryResponse::factory()->script('not valid javascript')->jquery('a')->blah();
 }, 'timeout' => 'timeout', 'chain' => function ($data, $complement) {
     $r = PheryResponse::factory($complement['submit_id'])->next('div');
     // If the select has a name, the value of the select element will be passed as
     // a key => value of it's name. Or it could be used as
     // PheryResponse::factory()->this->next('div');