0
如何在我的模塊/模型中翻譯我的自定義異常?最好的辦法是什麼?在php中翻譯模型異常 - Zf2 - Zend i18n - Poedit
1)直接進入MyModelTableGetaway.php。例如:
public function getAlbum($id)
{
$id = (int) $id;
$rowset = $this->tableGateway->select(array('id' => $id));
$row = $rowset->current();
if (!$row) {
throw new \Exception(__("Could not find row $id"));
}
return $row;
}
我會告訴poEdit的考慮到所有內部__()
2)創建一個文件夾爲MyModel /語言/ language_than_i_want進入這個文件夾,我可以把一個文件.PHP與一系列例外
什麼是更好,更快?還有其他方法嗎?
非常感謝