Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save wingsuitist/1300addd5edb0226ccf5 to your computer and use it in GitHub Desktop.

Select an option

Save wingsuitist/1300addd5edb0226ccf5 to your computer and use it in GitHub Desktop.
Fluid in pibase:
var $view;
public function getView($action) {
$this->extPath = t3lib_extMgm::extPath($this->extKey);
$this->view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
$this->view->setLayoutRootPath(t3lib_extMgm::extPath($this->extKey) . 'Resources/Private/Layouts/');
$this->view->setPartialRootPath(t3lib_extMgm::extPath($this->extKey) . 'Resources/Private/Partials/');
$view->setTemplatePathAndFilename($this->extPath . 'Resources/Private/Templates/'.$action.'.html');
// initialize locallang
$this->view->getRequest()->setControllerExtensionName($this->extKey);
}
public funciton main() {
... regular piBase stuff ...
$content = $this->singleView()...
...
private function singleView() {
$this->getView('Details');
$this->view->assign('value', $value);
return $this->view->render();
Private/Language/locallang.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<type>module</type>
<description>Language labels for plugin &quot;tx_extension_pi1&quot;</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="test">Test</label>
</languageKey>
</data>
</T3locallang>
Private/Templates/Details.html
{namespace v=Tx_Vhs_ViewHelpers}
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
f:schemaLocation="http://fluidtypo3.org/schemas/fluid-master.xsd"
xmlns:v="http://typo3.org/ns/vhs/ViewHelpers"
v:schemaLocation="http://fluidtypo3.org/schemas/vhs-master.xsd">
{f:layout(name: 'Default')}
<head>
<title>Partials: MyPartial</title>
</head>
<body>
<f:section name="Main">
</f:section>
</body>
</html>
Private/Layouts/Default.html
<div class="tx-ic-contest">
<f:render section="Main" />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment