當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Input::setType方法代碼示例

本文整理匯總了PHP中Input::setType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Input::setType方法的具體用法?PHP Input::setType怎麽用?PHP Input::setType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Input的用法示例。


在下文中一共展示了Input::setType方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addInput

 public function addInput($value, $type_sensor)
 {
     $new_input = new Input();
     $new_input->setInformation($value);
     $new_input->setType($type_sensor);
     $this->setInput($new_input);
 }
開發者ID:CICC-RG,項目名稱:tictactoe,代碼行數:7,代碼來源:objectlevel.php

示例2: __construct

 /**
  * Método construtor
  * @param string $name Nome do campo
  * @param string $value Valor do campo
  * @param string $label Legenda do campo
  */
 public function __construct($name, $value, $label)
 {
     parent::setName($name);
     parent::setValue($value);
     parent::setLabel($label);
     parent::setType('password');
 }
開發者ID:fernandopetry,項目名稱:pwork,代碼行數:13,代碼來源:Password.php

示例3: setType

 /**
  * Dont allow the type to be overridden
  * @see Foundation\Form\Element.Input::setType()
  */
 public function setType($type)
 {
     if (!\in_array($type, array('submit', 'button', 'reset'))) {
         $message = "A type of {$type} is not allowed.  Only 'button', " . "'submit' and 'reset' are allowed for this element";
         throw new \Foundation\Exception($message);
     }
     parent::setType($type);
 }
開發者ID:jazzee,項目名稱:foundation,代碼行數:12,代碼來源:ButtonInput.php

示例4: setType

 /**
  *  
  *  @see  parent::setType()
  */
 public function setType($val)
 {
     parent::setType($val);
     if (!$this->hasName()) {
         $this->setName(self::TYPE_SUBMIT);
     }
     //if
     if (!$this->hasVal()) {
         $this->setVal('Submit');
     }
     //if
 }
開發者ID:Jaymon,項目名稱:Montage,代碼行數:16,代碼來源:Submit.php

示例5: testVerificaSeOsDadosForamInseridos

 public function testVerificaSeOsDadosForamInseridos()
 {
     $input = new Input();
     $input->setType("text");
     $input->setId("inputUsuario");
     $input->setName("usuario");
     $input->setClass("form-control");
     $input->setProtected("protected");
     $input->setLabel("Usuário");
     $input->setAlert("Erro no field.");
     $input->setValue("valor");
     $this->assertEquals("text", $input->getType());
     $this->assertEquals("inputUsuario", $input->getId());
     $this->assertEquals("usuario", $input->getName());
     $this->assertEquals("form-control", $input->getClass());
     $this->assertEquals("protected", $input->getProtected());
     $this->assertEquals("Usuário", $input->getLabel());
     $this->assertEquals("Erro no field.", $input->getAlert());
     $this->assertEquals("valor", $input->getValue());
 }
開發者ID:joohnsro,項目名稱:TestesAutomatizadosProjFinal,代碼行數:20,代碼來源:InputTest.php

示例6: isHidden

 public function isHidden()
 {
     parent::setType('hidden');
     return $this;
 }
開發者ID:fernandopetry,項目名稱:pwork,代碼行數:5,代碼來源:Text.php

示例7: Form

$body->build();
include_once './inc/menubar.php';
$form = new Form();
$form->setAction('controller.php');
$form->build();
$table = new Table();
$table->build();
$i = 0;
$inp = new Input();
$inp->setName('data_id');
$inp->setValue($req->get('id'));
$inp->setType('hidden');
$data_table = new Input();
$data_table->setName('data_table');
$data_table->setValue($req->get('table'));
$data_table->setType('hidden');
$tr = new Tr();
$tr->add($inp->dump());
$tr->add($data_table->dump());
$tr->add($cmd->dump());
$tr->build();
foreach ($res as $item) {
    $colname = $col[$i];
    if ($colname == 'id') {
        ++$i;
        continue;
    }
    // $length = strlen($item);
    $size = 50;
    /*
    if($length < 10) {
開發者ID:broozer,項目名稱:psa,代碼行數:31,代碼來源:edit_record.php

示例8: setcookie

} else {
    setcookie('testcookie', 'gone', time() - 3600);
    header('location: login.php');
    exit;
}
$sessie = new Session();
$valgeld = $sessie->getS('psa-valid');
if ($valgeld !== 'jaja') {
    header('location: login.php');
    exit;
}
$psa = new LitePDO('sqlite:./data/base.sqlite');
$q = "SELECT * FROM base";
$psa->qo($q);
$result = $psa->fo_one();
if (!$sessie->isS('psa-ext')) {
    $sessie->setS('psa-ext', $result->extension);
}
if (!$sessie->isS('psa-dir')) {
    $sessie->setS('psa-dir', $result->directory);
}
define('LIMIT', $result->nr_rows);
unset($psa);
$req = new Request();
$submit = new Input();
$submit->setName('submit');
$submit->setType('submit');
$cmd = new Input();
$cmd->setName('cmd');
$cmd->setType('hidden');
開發者ID:broozer,項目名稱:psa,代碼行數:30,代碼來源:autoload.php

示例9: setcookie

        $sessie->setS('psa-valid', 'jaja');
        /**/
        setcookie('testcookie', time(), time() + 300);
        header('location: controller.php');
        exit;
        /**/
    }
}
$submit->setValue('Let\'s go');
$inp_naam = new Input();
$inp_naam->setName('name');
$inp_naam->setSize(20);
$inp_naam->setAutofocus(true);
$inp_pass = new Input();
$inp_pass->setName('geheim');
$inp_pass->setType('password');
$inp_pass->setSize(20);
$html = new Page();
$html->setLanguage('nl-nl');
$html->build();
$head = new Head();
$head->setTitle('PSA - login');
$head->setCss('./css/psa.css');
$head->setJs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
$body->line('<h3>PHP SQLite Admin tool - log in</h3>');
$form = new Form();
$form->setAction('login.php');
$form->build();
開發者ID:broozer,項目名稱:psa,代碼行數:31,代碼來源:login.php

示例10: Input

$form->setJs(' onsubmit="return PSA.indexcol();" ');
$form->build();
// TODO: check if table name already exists
$name = new Input();
$name->setName('idxname');
$name->setSize(50);
$name->setMaxlength(128);
$name->setId('idxname');
$body->line('Name : ' . $name->dump() . ' ' . $cmd->dump() . '<br>');
for ($i = 0; $i < sizeof($fields); ++$i) {
    $select = new Select();
    $select->setName('col' . $i);
    $select->setSize(1);
    $select->add('', '-');
    for ($j = 0; $j < sizeof($fields); ++$j) {
        $select->add($fields[$j], $fields[$j]);
    }
    $body->line('index on : ' . $select->dump() . '<br>');
}
$submit->build();
$tblname = new Input();
$tblname->setName('tblname');
$tblname->setSize(128);
$tblname->setValue($req->get('table'));
$tblname->setType('hidden');
$tblname->build();
unset($form);
$body->line('</div>');
include_once './inc/footer.php';
unset($body);
unset($html);
開發者ID:broozer,項目名稱:psa,代碼行數:31,代碼來源:index_add.php

示例11: Input

$colsize->setName('colsize');
$colsize->setSize(7);
$colsize->setMaxlength(7);
$colsize->setId('colsize');
$colsize->setJs(' onblur="PSA.checknumeric();" ');
$colnull = new Input();
$colnull->setName('colnull');
$colnull->setType('checkbox');
$colnull->setId('colnull');
$coldefault = new Input();
$coldefault->setName('coldefault');
$coldefault->setSize(25);
$coldefault->setMaxlength(128);
$coldefault->setId('coldefault');
$fieldadd = new Input();
$fieldadd->setType('button');
$fieldadd->setName('fieldadd');
$fieldadd->setValue('add');
$fieldadd->setJs(' onclick="PSA.addField();" ');
$tr = new Tr();
$tr->add($colname->dump());
$tr->add($coltype->dump());
$tr->setClas('center');
$tr->add($colprime->dump());
$tr->setClas('center');
$tr->add($colsize->dump());
$tr->setClas('center');
$tr->add($colnull->dump());
$tr->add($coldefault->dump());
$tr->add($fieldadd->dump());
$tr->build();
開發者ID:broozer,項目名稱:psa,代碼行數:31,代碼來源:table_add.php


注:本文中的Input::setType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。