本文整理汇总了PHP中Phalcon\Tag::setDefaults方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::setDefaults方法的具体用法?PHP Tag::setDefaults怎么用?PHP Tag::setDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phalcon\Tag
的用法示例。
在下文中一共展示了Tag::setDefaults方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
/**
* 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: indexAction
/**
* 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: formDefaults
/**
* 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: setDefaults
public static function setDefaults(array $values, $merge = false)
{
parent::setDefaults($values, $merge);
}
示例5: testDefault
public function testDefault()
{
Tag::setDefault('username', 'dreamsxin');
$this->assertEquals(Tag::getDefault('username'), 'dreamsxin');
$data = array('username' => 'dreamsxin', 'email' => 'dreamsxin@qq.com');
Tag::setDefaults($data);
$this->assertEquals(Tag::getDefaults(), $data);
}