2013-07-13 176 views
0

我試圖擴展powermail(版本2),可以爲每個輸入字段添加註釋。到目前爲止,我已經使用擴展生成器創建了一個新擴展,並對ext_tables.php進行了一些修改,該字段顯示在後端。這個新字段被稱爲'note',我認爲我可以在流體模板input.html中做一些像{field.note}這樣的操作,但這不起作用。我的模型包括setter和getter:TYPO3 - 擴展新字段的extbase擴展,並在流體模板中使用這些擴展

類Tx_Formnotes_Domain_Model_Powermailnotes擴展Tx_Extbase_DomainObject_AbstractEntity {

/** 
* note 
* 
* @var string 
*/ 
protected $note; 

/** 
* Returns the note 
* 
* @return string $note 
*/ 
public function getNote() { 
    return $this->note; 
} 

/** 
* Sets the note 
* 
* @param string $note 
* @return void 
*/ 
public function setNote($note) { 
    $this->note = $note; 
} 

}

需要什麼呢?

信息:我使用TYPO3 4.7

回答

0

你可以在此之後,powermail模型像

config.tx_extbase.persistence.classes { 

Tx_Formnotes_Domain_Model_Powermailnotes { 
    mapping { 
     tableName = powermailTableName 
     columns { 
      exampleMedia.mapOnProperty = media 
     } 
    } 
} 
} 

地圖,你應該使用這些屬性來擴展你的TCA。至少你可以爲每個屬性編寫setter和getter,並在流體模板中使用它們。

+0

你是什麼意思「擴展你的TCA」。我需要做的比已經由擴展生成器創建的更多嗎? – user1708687

+0

您必須添加您的映射字段以使用setter或getters訪問這些屬性。 – freshp