本文整理汇总了PHP中object::display方法的典型用法代码示例。如果您正苦于以下问题:PHP object::display方法的具体用法?PHP object::display怎么用?PHP object::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Binds template files with a Smarty
*
* @author Rafal Wesolowski <wesolowski@nexus-netsoft.com>
* @param string $sFileName template filename
* @return void
*/
public function render($sFileName)
{
$sTplPath = dirname(__DIR__) . '/views/page/';
$this->oSmarty->setTemplateDir($sTplPath);
$this->oSmarty->assign($this->aData);
$this->oSmarty->display($sTplPath . $sFileName . '.tpl');
}
示例2: content
/**
* Step content
*/
public function content()
{
printf('<p class="lead-text align-center">%s</p>', __('Please tell us more about your website (all fields are required)', 'wp-easy-mode'));
$this->fields->display();
/**
* Fires after the Settings content
*/
do_action('wpem_step_settings_after_content');
}
示例3: gallery_table
/**
* display() echo's the table right away, send the output to an object buffer and return the
* contents for use in mustache
*
* @return string HTML form and table
*/
public function gallery_table()
{
ob_start();
echo '<form id="vimeography-gallery-list" method="get">';
echo '<input type="hidden" name="vimeography-action" value="bulk_process_galleries">';
echo '<input type="hidden" name="page" value="vimeography-edit-galleries" />';
$this->_table->search_box('search', 'search_id');
$this->_table->display();
echo '</form>';
$result = ob_get_contents();
ob_end_clean();
return $result;
}
示例4: display
/**
* display
*
* The Framework_Presenter_Module class only renders the module's template
* file and not the page template that the Framework_Presenter_Smarty
* presenter renders as well.
*
* @access public
* @return void
*/
public function display()
{
$this->template->assign('modulePath', $path);
$this->template->assign('site', Framework::$site);
$this->template->assign('tplFile', $tplFile);
$this->template->assign('user', $this->user);
$this->template->assign('session', $this->session);
foreach ($this->module->getData() as $var => $val) {
if (!in_array($var, array('path', 'tplFile'))) {
$this->template->assign($var, $val);
}
}
$this->template->display($this->module->tplFile);
}
示例5: createHTML
/**
* Create the HTML code for the module.
* First the createHTMLLabels() will be called to add all labels to the template,
* Then the tpl_id set in $this->getTemplateId() will be added to the main template automatically
*/
public function createHTML()
{
// add JS and CSS files
$this->tpl->addJS('monitor.js');
$this->tpl->addCSS('monitor.css');
if (sm_get_conf('show_update')) {
// user wants updates, lets see what we can do
$this->createHTMLUpdateAvailable();
}
$this->createHTMLLabels();
// add the module's custom template to the main template to get some content
$this->tpl->addTemplatedata('main', array('content' => $this->tpl->getTemplate($this->getTemplateId()), 'message' => $this->message == '' ? ' ' : $this->message));
// display main template
echo $this->tpl->display('main');
}
示例6: textbox_tables_list
/**
* Print the content of the "All Tables" text box
*
* @since 1.0.0
*/
public function textbox_tables_list($data, $box)
{
if (!empty($_GET['s'])) {
printf('<span class="subtitle">' . __('Search results for “%s”', 'tablepress') . '</span>', esc_html(stripslashes($_GET['s'])));
}
?>
<form method="get" action="">
<?php
if (isset($_GET['page'])) {
echo '<input type="hidden" name="page" value="' . esc_attr($_GET['page']) . '" />' . "\n";
}
$this->wp_list_table->search_box(__('Search Tables', 'tablepress'), 'tables_search');
?>
</form>
<form action="<?php
echo admin_url('admin-post.php');
?>
" method="post">
<?php
// this prints the nonce and action fields for this screen (done here instead of render(), due to moved <form>):
$this->do_text_boxes('header');
$this->wp_list_table->display();
?>
</form>
<?php
}
示例7: get
/**
* Gets http or ajax template according to request and assign variables.
*
* @return avoid
*/
public function get()
{
$this->setLinkVars();
$this->setLangVars();
if ($this->vars->get('ctr') && $this->vars->get('ctr') == 'ajaxCommander') {
$template = $this->getAjaxTemplate();
if ($template['response'] == 'json') {
print $template['data'];
} else {
$this->smarty->display($template['data']);
}
} else {
$this->loadResources();
$this->smarty->display($this->getHttpTemplate());
}
}
示例8: display
/**
* 调用view的display接口
* 将$this->vars输出到模板
*
* @stability: 4
* @param string $name
* @return void
*/
protected function display($templateFile = '', $charset = '', $contentType = '', $content = '', $prefix = '')
{
if ($this->vars) {
$this->view->assign($this->vars);
}
$this->view->display($templateFile, $charset, $contentType, $content, $prefix);
}
示例9: show
/**
* Render specified template
*
* @param String $name - template name inside a subdirectory of "views" named after the controller
* @return void
*/
function show($name)
{
// path to template
$path = strtolower(preg_replace("/Controller/", "", $this->controller) . "/{$name}.tpl");
// check template file exists
if (file_exists(APP_PATH . "/views/{$path}") == false) {
throw new Exception("Template not found in {$path}");
return false;
}
// assign variables
foreach ($this->vars as $key => $value) {
$this->smarty->assign($key, $value);
}
// render template
$this->smarty->display($path);
}
示例10: notify
/**
* Listens all progress events from this monitor.
*
* @param mixed $event A hash describing the progress event.
*
* @return void
* @since 1.0
* @access public
* @throws HTML_PROGRESS_ERROR_INVALID_INPUT
* @see callProgressHandler()
*/
function notify($event)
{
if (!is_array($event)) {
return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception', array('var' => '$event', 'was' => gettype($event), 'expected' => 'array', 'paramnum' => 1), PEAR_ERROR_TRIGGER);
}
$log = strtolower($event['log']);
if ($log == 'incvalue') {
if (!is_null($this->_callback)) {
$this->callProgressHandler($event['value'], $this);
}
$this->_progress->display();
// sleep a bit ...
for ($i = 0; $i < $this->_anim_speed * 1000; $i++) {
}
if ($this->_progress->getPercentComplete() == 1) {
if ($this->_progress->isIndeterminate()) {
$this->_progress->setValue(0);
} else {
// the progress bar has reached 100%
$this->_progress->removeListener($this);
}
} else {
$this->_progress->incValue();
}
}
}
示例11: renderFile
/**
* 解析视图文件
*
* @param string $file
*/
public function renderFile($file)
{
// 开启smarty模版引擎后, 实例化smarty对象
switch (Imp::app()->instance('config')->get('template')) {
case 'smarty':
Loader::load('vendor/Imp/Core/Template');
$smartyObject = new Template();
$this->smarty = $smartyObject->smarty;
$this->smarty->assign($this->tpl_var);
$this->smarty->display($file);
break;
default:
echo $this->readFileContent($file);
break;
}
}
示例12: testDisplay
/**
* Test the display() function
*
* @return void
*/
public function testDisplay()
{
// Setup
$content = 'anything';
// Test display() with all null params
$this->handler = new RDFa();
$this->assertEquals($this->handler->display(), '');
// Test if the params are reseted after the display() function
$this->handler->setType('Article')->content($content)->property('name')->fallback('Thing', 'url')->display();
$this->assertNull($this->handler->getFallbackProperty());
$this->assertNull($this->handler->getFallbackType());
$this->assertNull($this->handler->getProperty());
$this->assertNull($this->handler->getContent());
// Test for a simple display
$response = $this->handler->property('url')->display();
$this->assertEquals($response, "property='url'");
// Test for a simple display with $content
$response = $this->handler->property('url')->content($content)->display();
$this->assertEquals($response, "<span property='url'>{$content}</span>");
// Test for a simple display if the $content is empty ''
$response = $this->handler->enable(true)->content('')->property('name')->display();
$this->assertEquals($response, "<span property='name'></span>");
// Test for a simple 'nested' display
$response = $this->handler->property('author')->display();
$this->assertEquals($response, "property='author' vocab='https://schema.org' typeof='Organization'");
// Test for a 'nested' display with $content
$response = $this->handler->property('author')->content($content)->display();
$this->assertEquals($response, "<span property='author' vocab='https://schema.org' typeof='Organization'>{$content}</span>");
// Test for a 'nested' display with $content and $Fallback
$response = $this->handler->fallback('Person', 'name')->property('author')->content($content)->display();
$this->assertEquals($response, "<span property='author' vocab='https://schema.org' typeof='Person'><span property='name'>{$content}</span></span>");
// Test for a 'nested' display with $Fallback and without $content
$response = $this->handler->fallback('Person', 'name')->property('author')->display();
$this->assertEquals($response, "property='author' vocab='https://schema.org' typeof='Person' property='name'");
// Test for a 'meta' display without $content
$response = $this->handler->property('datePublished')->display();
$this->assertEquals($response, "property='datePublished'");
// Test for a 'meta' display with $content
$content = '01 January 2011';
$response = $this->handler->property('datePublished')->content($content)->display();
$this->assertEquals($response, "<meta property='datePublished' content='{$content}'/>{$content}");
// Test for a 'meta' display with human $content and $machineContent
$machineContent = "2011-01-01T00:00:00+00:00";
$response = $this->handler->property('datePublished')->content($content, $machineContent)->display();
$this->assertEquals($response, "<meta property='datePublished' content='{$machineContent}'/>{$content}");
// Test when if fallbacks that the library returns an empty string as specified
$response = $this->handler->content('en-GB')->property('doesNotExist')->display('meta', true);
$this->assertEquals($response, '');
// Test if the library is disabled
$response = $this->handler->enable(false)->content($content)->fallback('Article', 'about')->property('datePublished')->display();
$this->assertEquals($response, $content);
// Test if the library is disabled and if it have a $content it must return an empty string
$response = $this->handler->enable(false)->content('en-GB')->property('inLanguage')->fallback('Language', 'name')->display('meta', true);
$this->assertEquals($response, '');
// Test if the params are reseted after display(), if the library is disabled
$this->assertNull($this->handler->getFallbackProperty());
$this->assertNull($this->handler->getFallbackType());
$this->assertNull($this->handler->getProperty());
$this->assertNull($this->handler->getContent());
}
示例13: testInject
/**
* testInject method
*
* @access public
* @return void
*/
public function testInject()
{
$result = array();
for ($i = 1; $i <= 10; $i++) {
$result[$i] = $this->Adsense->inject($i, $ads = array(3 => $this->Adsense->display('text', 'banner'), 6 => $this->Adsense->display('text', 'button'), 9 => $this->Adsense->display('image', 'banner')), array(), true);
}
$this->assertTrue(!empty($result[3]));
$this->assertTrue(!empty($result[6]));
$this->assertTrue(!empty($result[9]));
}
示例14: show
/**
* Loads the default or custom template (tpl) file and prints it out.
* Enter the template file for appropriate script here.
*
* @param string The name of the template to be loaded
* @param string If another plugin is to be used in the directory.
*/
public function show($load_view = false, $plugin = false)
{
// Get correct tpl file.
$tpl_dir = $this->getTpl($load_view, $plugin);
if (empty($tpl_dir)) {
return false;
}
// Execute template else just skip it.
$this->view->display($tpl_dir);
}
示例15: display
/**
* display
*
* @access public
* @return void
*/
public function display()
{
$path = Framework_Template::getPath($this->module->tplFile, Framework::$request->module);
$this->template->assign('modulePath', $path);
$this->template->assign('site', Framework::$site);
$this->template->assign('tplFile', $this->module->tplFile);
$this->template->assign('user', $this->user);
$this->template->assign('session', $this->session);
foreach ($this->module->getData() as $var => $val) {
if (!in_array($var, array('path', 'tplFile'))) {
$this->template->assign($var, $val);
}
}
if ($this->module->pageTemplateFile == null) {
$pageTemplateFile = 'page.tpl';
} else {
$pageTemplateFile = $this->module->pageTemplateFile;
}
$this->template->display($pageTemplateFile);
}