[Typo3-dev] PHP syntax

Søren Vedel sv at workhouse.dk
Sun Sep 4 17:55:27 CEST 2005


I'm getting closer and understand better now - a little...

Kraft Bernhard wrote:

> Or you insert the following code into the "switch" statement of the 
> method "getFieldContent"
> then getFieldContent('type') will return the correct value directly:
> ----------------
> switch ($field) {
>   ...
> 
>   case 'type':
>     return 
> $this->pi_getLL('tx_telexadresses_filiaisfranquaias.type.I.'.$this->internal['currentRow']['type']); 
> 

I chose the "switch" way.

I copied
from: my_ext/locallang_db.php
to: my_ext/pi1/locallang.php

Now my_ext/pi1/locallang.php is like this:

-------------------
$LOCAL_LANG = Array (
   "default" => Array (
     "listFieldHeader_type" => "Type",	
     "tx_telexadresses_filiaisfranquias.type.I.0" => "Filiais",
     "tx_telexadresses_filiaisfranquias.type.I.1" => "Franquias",
     "listFieldHeader_city" => "City",	
     "listFieldHeader_state" => "State",	
...
-------------------


And my my_ext/pi1/class.tx_telexadresses_pi1.php is like this:

-------------------
function getFieldContent($fN)	{
   switch($fN) {
   case "type":
     return 
$this->pi_getLL('tx_telexadresses_filiaisfranquaias.type.I.'.$this->internal["currentRow"]["type"]); 

break;
...
-------------------

Now I get nothing in the output?

Still missing something...

> 
> It would also be possible by including the my_ext/locallang_db.php 
> directly but this is rather
> complicated than just copying the lines ... and I think you prefer the 
> simple solution :)

I take the simple solution for now, but I would prefer to take the value 
from my_ext/locallang_db.php directly, since it already has been defined 
here. It seems more correct to me.

- Søren




More information about the TYPO3-dev mailing list