1

我正在阅读typo3 扩展文件,并看到以下代码:

function main($content, $conf) {

        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();
        $this->template = $this->cObj->fileResource($this->conf['templateFile']);
        $GLOBALS['TSFE']->set_no_cache();

我曾经var_dump($conf);输出$conf,它显示:

array(53) { ["includeLibs"]=> string(47) "typo3conf/ext/jc_job/pi1/class.tx_jcjob_pi1.php" ["userFunc"]=> string(18) "tx_jcjob_pi1->main" ["templateFile"]=> string(28) "EXT:jc_job/pi1/template.html" ["pidList"]=> string(1) "7" ["code"]=> string(4)...

从结果中,我可以看出一些配置来自这个文件:ext_typoscript_setup.txt,但有些不是。

所以我的问题是:

里面是$conf什么?或者什么文件组成 $conf

4

2 回答 2

1

您的插件通过以下方式配置:

plugin.tx_yourextension_pi1 {
   # these values will you have in $conf
   someValue = well where it goes?
   wrap = wrap|me
   something {
     different = 1
   }
}

所以 $conf 看起来像这样:

  $conf = array(
    'someValue' => 'well where it goes?',
    'wrap' => 'wrap|me',
    'something.' => array(
      'different' => '1',
    )
  )
于 2013-07-26T07:38:08.520 回答
1

的最终结果$conf本质上是来自plugin.tx_yourextension_pi1.

这将是ext_typoscript_setup.txt您的扩展中的内容,以及在此过程中所做的任何更改。例如在主模板中,您还可以更改插件的配置。

于 2013-07-26T10:07:19.027 回答