本文整理汇总了PHP中Dropdown::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::__construct方法的具体用法?PHP Dropdown::__construct怎么用?PHP Dropdown::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct($name, $value, $valueTable, $valueField = 'nefub_id', array $where = array(), $orderBy = 'name', $direction = 'ASC', $limit = null)
{
parent::__construct($name, (int) $value);
$rows = Database::select_rows($valueTable, $where, $orderBy, $limit, $direction);
$this->addOption('Geen', 0);
foreach ($rows as $row) {
$this->addOption($row['name'], $row[$valueField]);
}
}
示例2:
function __construct($name, $value, $min = 0, $max = 99)
{
parent::__construct($name, $value);
$this->addOption('Geen', 0);
for ($i = 0; $i <= $max; $i++) {
$this->addOption($i, $i);
}
$this->addAttributes(array('class' => 'numeric'));
}
示例3: CONCAT
function __construct($name, $value)
{
parent::__construct($name, (int) $value);
$query = "SELECT Team.nefub_id, CONCAT(Team.name, ' (', Competition.name, ')') as name\r\n\t\t\t\t\tFROM Team\r\n\t\t\t\t\tLEFT JOIN Competition ON Team.competition_nefub_id = Competition.nefub_id\r\n\t\t\t\t\tORDER BY Team.name ASC, Competition.name ASC";
$rows = Database::select_rows_by_query($query);
$this->addOption('Geen', 0);
foreach ($rows as $row) {
$this->addOption($row['name'], $row['nefub_id']);
}
}
示例4: substr
function __construct($name, $value, $fieldType)
{
parent::__construct($name, $value);
$enumValues = substr($fieldType, 4, strlen($fieldType) - 4);
eval('$values = array' . $enumValues . ';');
foreach ($values as $value) {
$this->addOption($value, $value);
}
$this->addAttributes(array('class' => 'numeric'));
}
示例5: CONCAT
function __construct($name, $value)
{
parent::__construct($name, (int) $value);
$query = "SELECT Location.nefub_id, CONCAT(Location.name, ', ', Location.city) as name\r\n\t\t\t\t\tFROM Location\r\n\t\t\t\t\tORDER BY Location.name ASC, Location.city ASC";
$rows = Database::select_rows_by_query($query);
$this->addOption('Geen', 0);
foreach ($rows as $row) {
$this->addOption($row['name'], $row['nefub_id']);
}
}
示例6:
function __construct($name, $value, Game $oGame)
{
parent::__construct($name, $value);
$this->addOption($oGame->getTeam1()->name . '-' . $oGame->getTeam2()->name, $value);
}