[TYPO3-mvc] namespaces and class names

Florian florian.typo3 at oktopuce.fr
Tue Oct 1 17:55:10 CEST 2013


Hello,

For using namespace you have to add it in your php file :

<?php
namespace MYSOCIETY\MyExt\MyDirectory;

class MyClass extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
     protected function myFunction() {
         ...
     }
}
?>

and when you want to call your function :

// Instanciate your class
$myObject = new \MYSOCIETY\MyExt\MyDirectory\MyClass()

// Call you function
$myObject->myFunction();

Regards,
Florian RIVAL
www.oktopuce.fr <http://www.oktopuce.fr/>

P*Please consider the environment before printing this email*
Le 01/10/2013 14:48, Dominic Garms a écrit :
> Hello,
>
> how does PHP solves an extension, which is using the same namespace 
> and class name as another extension? I currently work with the 
> extension static_info_tables and used the language upgrade pack for 
> creating an extension static_info_tables_de. Inside of the "_de" the 
> namespace, class names and filenames are the same of the model 
> classes. Inside of the "_de" extension the additional properties for 
> the languages and their getter and setter are included.
>
> Now I stumbled over an error that $this->_hasProperty("shortNameDe") 
> is not accessible. Could it belong because of the same naming instead 
> of extending the class? Why are all other properties accessible, only 
> the properties of the "_de" package are missing.
>
> Cheers,
> Dominic
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list