예제 #1
0
 public function testIssue744()
 {
     $v = new Phalcon\Tag();
     try {
         $v->setDI(0);
         $this->assertTrue(false);
     } catch (Exception $e) {
         $this->assertTrue(true);
     }
     try {
         $v->setDI(new stdClass());
         $this->assertTrue(false);
     } catch (Exception $e) {
         $this->assertTrue(true);
     }
     try {
         $v->setDI(new Phalcon\DI());
         $this->assertTrue(true);
     } catch (Exception $e) {
         $this->assertTrue(false);
     }
     try {
         $v->setDI(new DIDescendant());
         $this->assertTrue(true);
     } catch (Exception $e) {
         $this->assertTrue(false);
     }
     try {
         $v->setDefaults(0);
         $this->assertTrue(false);
     } catch (Exception $e) {
         $this->assertTrue(true);
     }
 }
예제 #2
0
<?php

//Assigning "peter" to "name" component
Phalcon\Tag::setDefaults(array("name" => "peter"));
//Later in the view
echo Phalcon\Tag::textField("name");
//Will have the value "peter" by default