Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
public function _initTranslate()
{
// this will make App_Translate use the right language
$translate = new Zend_Translate('array', APPLICATION_PATH . '/languages/en.php', 'en');
Zend_Registry::set('Zend_Translate', $translate);
return $translate;
}
* This source code was highlighted with Source Code Highlighter.; ==============================================================================
; TRANSLATE
; ==============================================================================
resources.translate.registry_key = "Zend_Translate"
resources.translate.data = APPLICATION_PATH "/languages"
resources.translate.adapter = "Zend_Translate_Adapter_Ini"
resources.translate.locale = "auto"
resources.translate.options.clear = false
resources.translate.options.disableNotices = false
resources.translate.options.ignore = "."
;resources.translate.options.locale = "auto"
;resources.translate.options.log = null
;resources.translate.options.logMessage = "Untranslated message within '%locale%': %message%"
;resources.translate.options.logUntranslated = false
resources.translate.options.scan = null
;resources.translate.options.delimiter = ;
;resources.translate.options.enclosure = '"
;resources.translate.options.length = 0
* This source code was highlighted with Source Code Highlighter.Big time catch! Thanks for finding this. That deserved an immediate hot-fix. If you try it now on a random id you should see the standard Zend error page saying that the list could not be found.
I really appreciate you submitting this one. Thanks a lot. I still need to update the source code download to include the fix.
Since you might already have the source code: I fixed the following line of code in TaskController.php (frontend module) to the following:
$this->view->tasklist = $model_list->getList($list_id, $user_id);
I added the $user_id parameter.
Thanks Again, Greg Wessels
$session = $this->getSession();
$session->unsetAll();
* This source code was highlighted with Source Code Highlighter.Zend_Auth::getInstance()->clearIdentity();
* This source code was highlighted with Source Code Highlighter.public function getUser($id)
{
$select = $this->select()->where('id = ?', (int)$id);
$user = $this->fetchRow($select);
if (!$user) {
throw new Exception("user [$id] not found!");
}
return $user->toArray();
}
* This source code was highlighted with Source Code Highlighter.You sure could accomplish the same thing that way. My opinion is that I favor the API module approach because of the session — I don’t touch or establish a session for requests coming in to the API module. So that way I can separate the controllers that depend on a session and the currently logged in user vs the API controllers which completely depend on the api keys coming in on each request. My 2 cents.
Although it looks like the bootstrap is initializing the Session everytime — I need to fix that. Regardless, no user information is pulled out of the session for API module requests
Greg
API — Шмапи
Так появилась идея что у будет некое приложение содержащее наработки основываясь на котором мы сможем быстрее приступить к реализации произвольных задач, не повторяя уже пройденные ранее моменты.Они не собираются конкурировать, приложения делалось не приложения ради, а пользы для.
Помацать Zend_Form
Менеджер задач «Dodo»