문제

I'm trying to start working with the Typo3 Fluid templating engine, and I managed to get it running sort of the dirty way. But then I found the fedext.net project together with this demo. And tried following this tutorial. I end with the following directory structure:

typo3conf/
  ext/
    my_extension/
      Classes/
        Controller/
          PageController.php
      Configuration/
        constants.txt <empty for now>
        setup.txt
      Resources/
        Private/
          Layouts/
          Partials/
          Templates/
            Page/
              FrontPage.html
        Public/
      ext_autoload.php <empty>
      ext_emload.php
      ext_localconf.php <empty>
      ext_tables.php

PageController.php:

<?php
class Tx_MyExtension_Controller_PageController extends Tx_Fluidpages_Controller_AbstractPageController {

    public function frontPageAction() {
    }
}

setup.txt:

plugin.tx_myextension.view {
    templateRootPath = EXT:my_extension/Resources/Private/Templates/
    partialRootPath = EXT:my_extension/Resources/Private/Partials/
    layoutRootPath = EXT:my_extension/Resources/Private/Layouts/
}

FrontPage.html:

{namespace v=Tx_Vhs_ViewHelpers}
{namespace flux=Tx_Flux_ViewHelpers}
<f:layout name="Page" />
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
     xmlns:v="http://fedext.net/ns/vhs/ViewHelpers"
     xmlns:flux="http://fedext.net/ns/flux/ViewHelpers"
     xmlns:f="http://fedext.net/ns/fluid/ViewHelpers">

    <f:section name="Configuration">
        <flux:flexform id="default-page" label="Default page template">
            <flux:flexform.field.input name="settings.entryLevel"
                                       label="Main menu entry level override for this page only"
                                       eval="int,trim" minimum="0" maximum="6"
                                       default="{v:var.typoscript(path: 'lib.menu.main.entryLevel')}">
                <flux:flexform.field.wizard.slider hideParent="TRUE" step="1" width="100" />
            </flux:flexform.field.input>
        </flux:flexform>
        <flux:flexform.grid>
            <flux:flexform.grid.row>
                <flux:flexform.grid.column colPos="1" name="Hero Unit" />
            </flux:flexform.grid.row>
            <flux:flexform.grid.row>
                <flux:flexform.grid.column colPos="0" name="Main Content" />
            </flux:flexform.grid.row>
            <flux:flexform.grid.row>
                <flux:flexform.grid.column colPos="2" name="Footer Content" />
            </flux:flexform.grid.row>
        </flux:flexform.grid>
    </f:section>

    <f:section name="Content">
        <v:page.content.render column="0" />
    </f:section>

    <f:section name="AnotherSection">
        <!-- more sections as desired, rendering triggered from the "Page.html" Layout file -->
    </f:section>

</div>

ext_emconf.php

<?php

$EM_CONF[$_EXTKEY] = array (
    'title' => 'Homepage',
    'description' => 'Homepage',
    'category' => 'misc',
    'shy' => 0,
    'version' => '1.0.0',
    'dependencies' => '',
    'conflicts' => '',
    'priority' => '',
    'loadOrder' => '',
    'module' => '',
    'state' => 'stable',
    'uploadfolder' => 0,
    'createDirs' => '',
    'modify_tables' => '',
    'clearcacheonload' => 0,
    'lockType' => '',
    'author' => 'me',
    'author_email' => 'mail@me.com',
    'author_company' => 'me',
    'CGLcompliance' => NULL,
    'CGLcompliance_note' => NULL,
    'constraints' => 
    array (
        'depends' => 
        array (
            'typo3' => '6.1.0',
            'cms' => '',
            'flux' => '5.0.0',
        ),
        'conflicts' => 
        array (
            'templavoila' => '',
        ),
        'suggests' => 
        array (
        ),
    ),
);

?>

ext_tables.php

<?php
if (!defined ('TYPO3_MODE')) {
    die ('Access denied.');
}

t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'My Extension Homepage');
Tx_Flux_Core::registerProviderExtensionKey('my_extension', 'Page');

SO, THE PROBLEM IS: Though the backend seems to work, I'm constantly getting PHP fatal-error in the front-end:

Core: Error handler (FE): PHP Warning: Invalid argument supplied for foreach() in C:\xampp\apache\htdocs\typo-fluid\typo3temp\Cache\Code\cache_core\ClassLoader_AbstractConfigurationProvider_bc71b4377996b2e6d72f.php line 481

While debugging I found out that the supplied value is null. Looks like I'm missing something simple. But the file structure above is just slightly modified version of this thing

Is there any good step-by-step tutorial how to create a couple of templates and content elements with fedext tools? Because I installed introduction package and tried copying settings in the backend and file structure, but looks like it is not enough and I'm missing something really basic here.

UPDATE: I've also seen this and this, and hope to get an answer from Claus Due as he is the author of fedext tools.

도움이 되었습니까?

해결책

So, looks like the main issue here was not the warning mentioned in the original question, but the error in the Apache log:

PHP Fatal error: Cannot redeclare class Tx_Vhs_Service_AssetService in...

which was caused by the PHP 5.3.3 incompatibility with the vhs extension. So, I've updated the PHP installation and fixed couple of typos in my extension configs, after that it started working as expected.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top