/** * 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(); }
/** * 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(); }
/** * 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; }
public static function setDefaults(array $values, $merge = false) { parent::setDefaults($values, $merge); }
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); }