예제 #1
0
 /**
  * The start action, it shows the "search" view
  */
 public function indexAction()
 {
     $searchParams = ['ping.batchId' => 'batchId', 'ping.proxyId' => 'proxyId', 'b.urlId' => 'urlId'];
     Tag::setDefaults(array('urlId' => $this->request->get('urlId'), 'proxyId' => $this->request->get('proxyId'), 'pingId' => $this->request->get('pingId'), 'batchId' => $this->request->get('batchId')));
     $this->view->pings = $this->searchPings($searchParams);
     $this->view->proxies = Proxy::find();
     $this->view->urls = Url::find();
     $this->view->batches = Batch::find();
     #$this->view->disable();
 }
예제 #2
0
 /**
  * The start action, it shows the "search" view
  */
 public function indexAction()
 {
     $batchId = $this->request->get('batchId');
     $name = $this->request->get('name');
     $httpCode = $this->request->get('httpCode');
     if (!is_numeric($httpCode)) {
         $httpCode = '';
     }
     if (is_numeric($batchId)) {
         $batch = Batch::findFirst($batchId);
         if (!empty($batch)) {
             $batch->name = $name ?: $batch->name;
         }
     } else {
         $batch = new Batch();
     }
     Tag::setDefaults(array('batchId' => $batchId, 'name' => $name, 'httpCode' => $httpCode));
     $this->view->batch = $batch;
     $this->view->batchIds = Batch::find();
     $this->view->pings = $this->searchPings();
     #$this->view->disable();
 }
예제 #3
0
 /**
  * Reconstructing \Phalcon\Tag::setDefaults via method chaining
  *
  * @param array $values
  * @param bool $merge
  *
  * @return mixed
  */
 public function formDefaults($values, $merge = false)
 {
     Tag::setDefaults($values, $merge);
     return $this;
 }
예제 #4
0
파일: Tag.php 프로젝트: mattvb91/cphalcon
 public static function setDefaults(array $values, $merge = false)
 {
     parent::setDefaults($values, $merge);
 }
예제 #5
0
 public function testDefault()
 {
     Tag::setDefault('username', 'dreamsxin');
     $this->assertEquals(Tag::getDefault('username'), 'dreamsxin');
     $data = array('username' => 'dreamsxin', 'email' => '*****@*****.**');
     Tag::setDefaults($data);
     $this->assertEquals(Tag::getDefaults(), $data);
 }