本文整理匯總了PHP中FORM::value_for方法的典型用法代碼示例。如果您正苦於以下問題:PHP FORM::value_for方法的具體用法?PHP FORM::value_for怎麽用?PHP FORM::value_for使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FORM
的用法示例。
在下文中一共展示了FORM::value_for方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _draw_folder_selector
/**
* @param FORM $form
* @param FORM_RENDERER $renderer
* @access private
*/
protected function _draw_folder_selector($form, $renderer)
{
$props = $renderer->make_list_properties();
$props->add_item('Context or none', Search_user_context_none);
$props->add_item('Selected folder(s)', Search_user_constant);
$props->add_item('NOT selected folder(s)', Search_user_not_constant);
/** @var $id_values int[] */
$id_values = $form->value_for('folder_ids');
$selected_folder_ids = array();
if (sizeof($id_values)) {
foreach ($id_values as $id) {
if ($id) {
$selected_folder_ids[$id] = $id;
}
}
}
$visible = $form->value_for('folder_search_type') != Search_user_context_none || sizeof($selected_folder_ids) > 0;
$layer = $renderer->start_layer_row('folders', 'Folder(s)', 'Toggle folder options.', $visible);
$renderer->start_row(' ');
echo $renderer->drop_down_as_html('folder_search_type', $props);
echo ' ';
$renderer->finish_row();
$renderer->start_row(' ');
$folder_query = $this->login->folder_query();
$folder_query->clear_results();
$folders = $folder_query->root_tree($this->app->root_folder_id);
$selected_folders = $folder_query->objects_at_ids($selected_folder_ids);
/* Make a copy (not a reference). */
$tree = $this->app->make_tree_renderer();
include_once 'webcore/gui/folder_tree_node_info.php';
$tree_node_info = new FOLDER_TREE_NODE_INFO($this->app);
include_once 'webcore/gui/selector_tree_decorator.php';
$decorator = new MULTI_SELECTOR_TREE_DECORATOR($tree, $selected_folder_ids);
$decorator->control_name = 'folder_ids';
$decorator->form_name = $form->name;
$decorator->auto_toggle_children = true;
$tree->node_info = $tree_node_info;
$tree->decorator = $decorator;
$tree->set_visible_nodes($selected_folders);
$tree->display($folders);
$renderer->finish_row();
$renderer->finish_layer_row($layer);
}