本文整理汇总了PHP中url::addObject方法的典型用法代码示例。如果您正苦于以下问题:PHP url::addObject方法的具体用法?PHP url::addObject怎么用?PHP url::addObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类url
的用法示例。
在下文中一共展示了url::addObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
/****************** Node Form items ******************/
if (isset($node)) {
foreach ($node->record->field as $field) {
if ($field->isUsedIn('edit')) {
$out['node_field'][$field->getName()]['ui'] = $field->renderUi('node_');
if ($field->getType() != 'id') {
$out['node_field'][$field->getName()]['title'] = $field->getTitle();
} else {
$out['node_field'][$field->getName()]['title'] = '';
}
$out['node_field'][$field->getName()]['help'] = $field->getHelp();
}
}
}
/****************** Relations ******************/
$url = new url();
$url->addObject($record, 'source_');
$out['relation']['url'] = $url->render('relation.php');
// clean url
$url = new url();
// describes the banner :
$out['banner']['needed'] = true;
$out['banner']['title'] = $record->getTitle();
//$out['banner']['message'] = $record->getHelp();
$out['banner']['image'] = $record->getIcon();
debug($out, 'OUT');
debug($_REQUEST, 'Request');
// include the templates
include 'header.template.php';
include 'edit.template.php';
include 'footer.template.php';
示例2: url
$url = new url();
$url->set('node_id', $current_node->getId());
//$url->addObject($current_node, 'current_');
$out['structure_breadcrumb'][$i]['url'] = $url->render();
$out['structure_breadcrumb'][$i]['current'] = true;
/************************ Allowed items ************************/
$allowed_items = $current_node->getAllowedItems();
if (is_array($allowed_items)) {
foreach ($allowed_items as $allowed_item) {
if ($allowed_item['class'] == 'record') {
$table = $thinkedit->newTable($allowed_item['type']);
$item['title'] = $table->getTitle();
$url = new url();
$url->set('mode', 'new_node');
$url->set('node_id', $current_node->getId());
$url->addObject($table);
$item['action'] = $url->render('edit.php');
$out['allowed_items'][] = $item;
}
}
}
/******************** Global paste ****************************/
/*
$url = new url();
$url->set('source_node', $current_node->getId());
$url->set('action', 'cut');
$out['clipboard']['cut_link'] = $url->render('clipboard.php');
*/
if ($session->get('clipboard_source_node')) {
$url = new url();
$url->set('target_node', $current_node->getId());
示例3: url
$url->set('source_node', $node_item->getId());
$url->set('action', 'cut');
$node_info['clipboard']['cut_link'] = $url->render('clipboard.php');
$url = new url();
$url->set('source_node', $node_item->getId());
$url->set('action', 'copy');
$node_info['clipboard']['copy_link'] = $url->render('clipboard.php');
$url = new url();
$url->set('target_node', $node_item->getId());
$url->set('action', 'paste');
$node_info['clipboard']['paste_link'] = $url->render('clipboard.php');
/******* locales links ****/
if ($content->isMultilingual()) {
$locales = $thinkedit->configuration->getLocaleList();
foreach ($locales as $locale) {
$url = new url();
$url->set('node_id', $node_item->getId());
$content->setLocale($locale);
$url->addObject($content);
$url->set('mode', 'edit_node');
$node_info['locale'][$locale]['edit_url'] = $url->render('edit.php');
$node_info['locale'][$locale]['locale'] = $locale;
}
}
/******* append this node info to out nodes list ****/
$out['nodes'][] = $node_info;
$i++;
}
}
require 'node.template.php';
//print_r ($out);
示例4: url
<?php
require_once '../class/url.class.php';
require_once '../class/record.class.php';
require_once '../thinkedit.init.php';
$url = new url();
$url->setParam('id', 7);
$url->setParam('action', 'move');
$url->setParam('locale', 'en');
$url->unSetParam('id');
echo '<pre>';
echo $url->render();
// try it with ./url.test.php?test_class=record&test_type=article&test_id=5
// and with url.test.php?test_class=record&test_type=article
echo $url->getParam('test');
$record = new record('article');
$record->set('id', 5);
$url->addObject($record, 'my_');
echo '<hr>';
echo $url->render();
$object = $url->getObject('test_');
$object->load();
echo '<hr>';
print_r($object);
示例5: foreach
// if we are in root
if ($we_are_root) {
$nodes[] = $current_node;
} else {
if ($current_node->hasChildren()) {
$nodes = $current_node->getChildren();
}
}
if (isset($nodes) && is_array($nodes)) {
$i = 0;
foreach ($nodes as $node_item) {
$content = $node_item->getContent();
$content->load();
$item['title'] = te_short($content->getTitle(), 40);
$item['icon'] = $content->getIcon();
$url = new url();
$url->keep('class');
$url->keep('mode');
$url->set('node_id', $node_item->getId());
$item['visit_url'] = $url->render();
if ($mode == 'relation') {
$url->addObject($node_item, 'target_');
$url->set('action', 'relate');
$item['url'] = $url->render('relation.php');
}
$out['items'][] = $item;
}
}
}
debug($out, 'OUT');
include 'browser.template.php';
示例6: foreach
if (is_array($allowed_items)) {
foreach ($allowed_items as $allowed_item) {
if ($allowed_item['class'] == 'record') {
$table = $thinkedit->newTable($allowed_item['type']);
$item['title'] = $table->getTitle();
$item['icon'] = $table->getIcon();
$url = new url();
$url->set('mode', 'new_node');
$url->set('node_id', $current_node->getId());
$url->addObject($table);
$item['action'] = $url->render('edit.php');
$url = new url();
$url->set('action', 'new_node');
$url->set('node_id', $current_node->getId());
$tmp_record = $thinkedit->newRecord($table->getId());
$url->addObject($tmp_record, 'object_');
$item['direct_add_action'] = $url->render();
$out['allowed_items'][] = $item;
}
}
}
/******************** Global paste ****************************/
/*
$url = new url();
$url->set('source_node', $current_node->getId());
$url->set('action', 'cut');
$out['clipboard']['cut_link'] = $url->render('clipboard.php');
*/
if ($session->get('clipboard_source_node')) {
$url = new url();
$url->set('target_node', $current_node->getId());