本文整理汇总了PHP中DataManager::getChannels方法的典型用法代码示例。如果您正苦于以下问题:PHP DataManager::getChannels方法的具体用法?PHP DataManager::getChannels怎么用?PHP DataManager::getChannels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::getChannels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<label for="inputName" class="col-sm-4 control-label">Username: </label>
<div class="col-sm-3">
<input type="text" class="form-control" id="username" name="username" placeholder="try 'scm4'" required>
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="col-sm-4 control-label">Password:</label>
<div class="col-sm-3">
<input type="password" class="form-control" id="inputPassword" name="password" placeholder="try 'scm4'" required>
</div>
</div>
<div class = "form-group">
<label for="channel" class="col-sm-4 control-label">Channel:</label>
<div class = "col-sm-3">
<?php
$channels = DataManager::getChannels();
foreach ($channels as $channel) {
?>
<div class="checkbox">
<label><input type="checkbox" name="channels[]" value="<?php
echo $channel->getName();
?>
"><?php
echo $channel->getName();
?>
</label>
</div>
<?php
}
?>
</div>
示例2: foreach
</div>
<div class="form-group">
<div class="row">
<label for="<?php
echo Controller::USR_CHANNELS;
?>
" class="col-lg-3 control-label">Channels:</label>
<div class="col-lg-8">
<select required class="form-control" id="example-getting-started" multiple="multiple"
name="<?php
echo Controller::USR_CHANNELS;
?>
[]">
<?php
foreach (DataManager::getChannels() as $channel) {
?>
<option value="<?php
echo $channel->getId();
?>
">
<?php
echo $channel->getName();
?>
</option>
<?php
}
?>
</select>
</div>
</div>