本文整理汇总了PHP中tx_rnbase::makeInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP tx_rnbase::makeInstance方法的具体用法?PHP tx_rnbase::makeInstance怎么用?PHP tx_rnbase::makeInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tx_rnbase
的用法示例。
在下文中一共展示了tx_rnbase::makeInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCObj
/**
* Returns an instanceof tslib_cObj or \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer.
* Since this object has functions for database access and frontend your ControllerAction
* should always provide cObj for model and view. This ensures only one instance per request.
*
* @return an instance of \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer or tslib_cObj
*/
function getCObj()
{
if (!$this->cObject) {
$this->cObject = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getContentObjectRendererClass());
}
return $this->cObject;
}
示例2: testGeneratorReturnsCorrectPlainTextWhenNoInfoTable
/**
* Prüft ob korrekter text zurück erzeugt wird
* Das umfasst auch Sonderzeichen
*/
public function testGeneratorReturnsCorrectPlainTextWhenNoInfoTable()
{
$aParams = array('defaultFontFace' => 0, 'defaultFontSize' => 22, 'paperOrientation' => 1, 'rtfVersion' => 1);
$oRTFGenerator = tx_rnbase::makeInstance('tx_mklib_util_RTFGenerator', $aParams);
$sRTFText = $oRTFGenerator->getRTF('###SPECIALCHAR_(###<strong>Das ist ein schöner Testtext.</strong> Auch mit ###SPECIALCHAR_)### verschiedenen ßonderzeichen und Ähnlichem. Sogar einem ###SPECIALCHAR_*###');
$this->assertEquals('{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fcharset0\\fnil Arial;}{\\f1\\fcharset0\\fnil Wingdings;}}{\\f0\\fs22\\dn0 }{\\f1\\fs25\\dn0 (}{\\f0\\fs22\\dn0}{\\b\\f0\\fs22\\dn0 Das ist ein sch\\\'f6ner Testtext. }{\\f0\\fs22\\dn0 Auch mit }{\\f1\\fs25\\dn0 )}{\\f0\\fs22\\dn0 verschiedenen \\\'dfonderzeichen und \\\'c4hnlichem. Sogar einem }{\\f1\\fs25\\dn0 *}{\\f0\\fs22\\dn0}}', $sRTFText, 'Der generierte Text ist falsch.');
}
示例3: testGetExtensionCfgValue
public function testGetExtensionCfgValue()
{
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dummyExtension'] = serialize(array('testConfig' => 'testConfigValue'));
$extensionConfiguration = tx_rnbase::makeInstance('tx_mklib_util_ExtensionConfigurationTest');
$testConfigValue = $extensionConfiguration->getTestConfig();
$this->assertEquals('testConfigValue', $testConfigValue);
}
开发者ID:RocKordier,项目名称:typo3-mklib,代码行数:7,代码来源:class.tx_mklib_tests_util_ExtensionConfiguration_testcase.php
示例4: send45
protected function send45()
{
/* @var $mail TYPO3\CMS\Core\Mail\MailMessage */
$mail = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getMailMessageClass());
$mail->setFrom(array($this->from => $this->fromName));
$mail->setTo(tx_rnbase_util_Strings::trimExplode(',', $this->toAsString));
$mail->setSubject($this->subject);
if ($this->replyTo) {
$mail->addReplyTo($this->replyTo, $this->replyToName);
}
// Or set it after like this
if ($this->htmlPart) {
$mail->setBody($this->htmlPart, 'text/html');
}
// Add alternative parts with addPart()
if ($this->textPart) {
$mail->addPart($this->textPart, 'text/plain');
}
if (!empty($this->attachments)) {
foreach ($this->attachments as $attachment) {
if (!$mail->attach(Swift_Attachment::fromPath($attachment['src']))) {
tx_rnbase_util_Logger::warn('Adding attachment failed!', 'rn_base', array('subject' => $mail->subject, 'to' => $this->toAsString, 'attachment' => $attachment));
}
}
}
$mail->send();
}
示例5: getConfig
private function getConfig($confArr)
{
$cObj = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getContentObjectRendererClass());
$configurations = tx_rnbase::makeInstance('tx_rnbase_configurations');
$configurations->init($confArr, $cObj, 'tx_rnbase', 'rnbase');
return $configurations;
}
示例6: getInstance
/**
* Liefert eine instanz des Validators
*
* @return tx_mklib_validator_ZipCode
*/
public static function getInstance()
{
if (!self::$instance) {
self::$instance = tx_rnbase::makeInstance('tx_mklib_validator_ZipCode');
}
return self::$instance;
}
示例7: getCurrentItem
/**
* Die dazu das aktuelle item für eine Detailseite zu holen bzw dieses zurückzusetzen.
* Dazu muss den Linker einfach folgendes für den action namen liefern: "show" + den eigentlichen key.
*
* Dann brauch man in der Detailansicht noch einen Button nach folgendem Schema:
* $markerArray['###NEWSEARCHBTN###'] = $formTool->createSubmit('showHowTo[clear]', '###LABEL_BUTTON_BACK###');
*
* @param string $key
* @param tx_rnbase_mod_IModule $module
*
* @return tx_rnbase_model_base
*/
public static function getCurrentItem($key, tx_rnbase_mod_IModule $module)
{
$itemid = 0;
$data = t3lib_div::_GP('show' . $key);
if ($data) {
list($itemid, ) = each($data);
}
$dataKey = 'current' . $key;
if ($itemid === 'clear') {
$data = t3lib_BEfunc::getModuleData(array($dataKey => ''), array($dataKey => '0'), $module->getName());
return false;
}
// Daten mit Modul abgleichen
$changed = $itemid ? array($dataKey => $itemid) : array();
$data = t3lib_BEfunc::getModuleData(array($dataKey => ''), $changed, $module->getName());
$itemid = $data[$dataKey];
if (!$itemid) {
return false;
}
$modelData = explode('|', $itemid);
$item = tx_rnbase::makeInstance($modelData[0], $modelData[1]);
if (!$item->isValid()) {
$item = null;
//auf null setzen damit die Suche wieder angezeigt wird
}
return $item;
}
示例8: getDamDB
private static function getDamDB()
{
if (!self::$damDb) {
self::$damDb = tx_rnbase::makeInstance('tx_dam_db');
}
return self::$damDb;
}
示例9: getStorage
/**
* Returns a storage
*
* @return Tx_Rnbase_Domain_Model_Data
*/
private function getStorage()
{
if ($this->storage === null) {
$this->storage = \tx_rnbase::makeInstance('Tx_Rnbase_Domain_Model_Data');
}
return $this->storage;
}
示例10: getInstance
/**
* Liefert eine Instanz einer konkreten Suchklasse. Der
* Klassenname sollte aber stimmen.
*
* @param string $classname
* @return tx_rnbase_util_SearchBase
*/
static function getInstance($classname)
{
if (!isset(self::$instances[$classname])) {
self::$instances[$classname] = tx_rnbase::makeInstance($classname);
}
return self::$instances[$classname];
}
示例11: testMakeInstanceOfExtBaseClass
/**
*/
function testMakeInstanceOfExtBaseClass()
{
if (!$this->isExtBasePossible()) {
$this->markTestSkipped();
}
$obj = tx_rnbase::makeInstance('Tx_T3sponsors_Domain_Model_Category');
$this->assertTrue(is_object($obj), 'Object not instantiated');
}
示例12: includeLocalLang
/**
* @return tx_rnbase_util_Lang
*/
private function includeLocalLang()
{
$llFile = $this->getLLFile();
/* @var $lang tx_rnbase_util_Lang */
$lang = tx_rnbase::makeInstance('tx_rnbase_util_Lang');
$lang->loadLLFile($llFile);
return $lang;
}
示例13: testMakeLink
public function testMakeLink()
{
$oLinker = tx_rnbase::makeInstance('tx_mklib_tests_fixtures_classes_DummyLinker');
$oModel = tx_rnbase::makeInstance('tx_rnbase_model_base', 1);
$oModel->uid = 1;
$oFormTool = tx_rnbase::makeInstance('tx_rnbase_util_FormTool');
$this->assertEquals('<input type="submit" name="showTest[tx_rnbase_model_base|1]" value="" />', $oLinker->makeLink($oModel, $oFormTool), 'Fsclher Link.');
}
示例14: __construct
/**
*/
public function __construct()
{
/** @var TcaDatabaseRecord $formDataGroup */
$formDataGroup = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormDataGroup\\TcaDatabaseRecord');
$this->formDataCompiler = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormDataCompiler', $formDataGroup);
$this->nodeFactory = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\NodeFactory');
$this->formResultCompiler = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormResultCompiler');
}
示例15: init
/**
* Init object
*
* @param tx_rnbase_mod_IModule $mod
* @param array $options
* @param string $sSelector
*/
protected function init(tx_rnbase_mod_IModule $mod, $options, $sSelector = 'tx_mklib_mod1_util_Selector')
{
$this->options = $options;
$this->mod = $mod;
$this->formTool = $mod->getFormTool();
$this->selector = tx_rnbase::makeInstance($sSelector);
$this->selector->init($mod);
}