---
title: "userfunc in flexform?"
url: "https://www.typo3.net/d/66880-userfunc-in-flexform"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage"]
created: "2007-08-16"
last_reply: "2007-08-20"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# userfunc in flexform?

Extensions › Entwicklung · 2 Antworten · gestartet 2007-08-16

## Eröffnungsbeitrag

**pranko_janko** · 2007-08-16 · [Beitrag #1](https://www.typo3.net/d/66880-userfunc-in-flexform/1)

hallo,

ich habe soeben zum ersten mal in flexform "<itemsProcFunc>" benutzt ...
und meine function wird auch aufgerufen jedoch wovon?
innerhalb meiner function

```php
class user_volume_flexFunctions {
	function getTemplates($config)
	{
		$dir = "/ext/myext/templates/";
	var_dump(is_dir($dir));
	if (is_dir($dir)) 
	{
	    if ($dh = opendir($dir)) 
	    {
		while (($file = readdir($dh)) !== false) 
		{
			$x= filetype($dir . $file);
			echo "test:".$x;
			$lable=  $x;
			$key= $x;
			$config['items'][]= array($lable, $key);
		}
		closedir($dh);
	    }
	}
		return $config;
	}
}
```

jedoch hab ich keine ahnung von wo ich den pfad relativ angebe?
direkt mit "/templates/" und "/typo3conf/ext/my_ext/templates/" oder "/ext/my_ext/templates/" funktioniert alles nicht!!

how to? leider hab ich keinen plan mehr ...

lg, pranko

## Antworten

### [#2](https://www.typo3.net/d/66880-userfunc-in-flexform/2) · UserNeo · 2007-08-19

Also es gibt eine globale Variable

```php
$GLOBALS['TYPO3_LOADED_EXT']['ext-key']['siteRelPath'].'pi1/class.zip.php';
```

Mal eine Frage zu itemsProcFunc, wie sieht das in der FlexForms XML aus? Und ist deine Klasse user_volume_flexFunctions in einer extra Datei oder befindet sich diese in der class.tx_ext_pi1.php Datei?

### [#3](https://www.typo3.net/d/66880-userfunc-in-flexform/3) · Norman2k · 2007-08-20

Siehe Wiki
<http://wiki.typo3.org/index.php/Extension_Development%2C_using_Flexforms#Dynamic_Data_in_Flexforms>

> You can now create a file class.tx_sampleflex_addFieldsToFlexForm.php in your extension directory and include it in ext_tables.php as
>
> include_once(t3lib_extMgm::extPath($_EXTKEY).'class.tx_sampleflex_addFieldsToFlexForm.php');

Norman

---

Quelle: „userfunc in flexform?“, typo3.net, https://www.typo3.net/d/66880-userfunc-in-flexform
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
