本文整理匯總了PHP中Application_Model_User::getHosts方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application_Model_User::getHosts方法的具體用法?PHP Application_Model_User::getHosts怎麽用?PHP Application_Model_User::getHosts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Application_Model_User
的用法示例。
在下文中一共展示了Application_Model_User::getHosts方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public function init()
{
// Add hosts autocomplete
$this->addElement('text', 'add_show_hosts_autocomplete', array('label' => _('Search Users:'), 'class' => 'input_text ui-autocomplete-input', 'required' => false));
$options = array();
$hosts = Application_Model_User::getHosts();
foreach ($hosts as $host) {
$options[$host['index']] = $host['label'];
}
//Add hosts selection
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
$hosts->setLabel(_('DJs:'))->setMultiOptions($options);
$this->addElement($hosts);
}
示例2: getHostsAction
public function getHostsAction()
{
$search = $this->_getParam('term');
$res = Application_Model_User::getHosts($search);
$this->view->hosts = Application_Model_User::getHosts($search);
}