我真的不了解 php,并且碰壁了。
问题是我的网站显示以下错误...
Fatal error: Using $this when not in object context in /hermes/web07/b2350/pow.thefoodie/htdocs/index.php on line 11
这是我的index.php 文件的开头...
<?php
/*
Joomla templates by Joomladesigns.co.uk
*/
// no direct access
define( 'YOURBASEPATH', dirname(__FILE__) );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<!--[if lte IE 6]>
<style type="text/css">
#main_body ul li { behavior: url(<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/iepngfix.htc) }
</style>
<script defer type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/js/pngfix.js"></script>
<![endif]-->
<link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/template_css.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/js/fx_styles.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/js/accordion.js"></script>
<?php
// *************************************************
//
// Template Parameters
//
// *************************************************
$h1 = $this->params->get("logo");
$linked_h1 = ($this->params->get("logoLinked", 1) == 0)?"false":"true";
$h1_title = $this->params->get("logoTitle");
$h2_motto = $this->params->get("logoMotto");
// Please do NOT change this unless you know what you doing.
$template_path = $this->baseurl.'/templates/'.$this->template; // template path
$default_font = "default";
// **************************************************
?>
</head>
任何帮助都会很棒,因为我完全迷失了。
这个错误是不言自明的。看起来有点令人窒息:
<?php echo $this->language; ?>
$this
仅适用于类方法内部。尝试找出“语言”的实际定义。您可以尝试更换$this->language
只用$language
但我不知道你的东西是如何设置的。
Edit:事实上,你似乎没有任何include
在那之前的所有陈述......所以nothing应该被定义。除非其他东西包括你的index.php
文件,但这对于包含索引来说有点不寻常。
如果您从某处复制 Joomla 模板,则可能将其放在错误的位置。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)