本文整理匯總了PHP中Gems_Loader::getImportLoader方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gems_Loader::getImportLoader方法的具體用法?PHP Gems_Loader::getImportLoader怎麽用?PHP Gems_Loader::getImportLoader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gems_Loader
的用法示例。
在下文中一共展示了Gems_Loader::getImportLoader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: answerImportAction
/**
* Import answers to a survey
*/
public function answerImportAction()
{
$controller = 'answers';
$importLoader = $this->loader->getImportLoader();
$params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);
$params['formatBoxClass'] = 'browser table';
$params['importer'] = $importLoader->getImporter($controller);
$params['importLoader'] = $importLoader;
$params['tempDirectory'] = $importLoader->getTempDirectory();
$params['importTranslators'] = $importLoader->getTranslators($controller);
$this->addSnippets('Survey_AnswerImportSnippet', $params);
}
示例2: loadFormData
/**
* Hook that loads the form data from $_POST or the model
*
* Or from whatever other source you specify here.
*/
protected function loadFormData()
{
$model = $this->getModel();
if ($this->request->isPost()) {
$this->formData = $model->loadPostData($this->request->getPost() + $this->formData, true);
} else {
// Assume that if formData is set it is the correct formData
if (!$this->formData) {
$this->formData = $model->loadNew();
}
}
if (!(isset($this->formData['import_id']) && $this->formData['import_id'])) {
$this->formData['import_id'] = mt_rand(10000, 99999) . time();
}
$this->_session = new \Zend_Session_Namespace(__CLASS__ . '-' . $this->formData['import_id']);
if (!(isset($this->_session->localfile) && $this->_session->localfile)) {
$importLoader = $this->loader->getImportLoader();
$this->_session->localfile = \MUtil_File::createTemporaryIn($importLoader->getTempDirectory(), $this->request->getControllerName() . '_');
}
// \MUtil_Echo::track($this->formData);
}
示例3: getImportTranslators
/**
* Get the possible translators for the import snippet.
*
* @return array of \MUtil_Model_ModelTranslatorInterface objects
*/
public function getImportTranslators()
{
return $this->loader->getImportLoader()->getTranslators($this->getRequest()->getControllerName());
}