本文整理汇总了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());
}