2011-02-23 43 views

回答

1

除了官方ZF quick start,我可以建議更換你看看Tutorial: Getting Started with Zend Framework 1.10。您還可以查看免費書籍:Zend Framework Book: Surviving The Deep EndZendCast

編輯。在下面的評論OP的要求,我貼bootstrap.php中的一些例子和ini文件:

bootstrap.php中

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { 

    // set a doctype for the Zend_View  
    protected function _initDoctype() { 
     $view = $this->bootstrap('view')->getResource('view'); 
     $view->doctype('XHTML1_STRICT'); 
    } 

    // add path to my view helpers 
    protected function _initHelperPath() { 
     $view = $this->bootstrap('view')->getResource('view'); 
     $view->setHelperPath(APPLICATION_PATH . '/views/helpers', 'My_View_Helper'); 
    } 

    // read appkey.ini and save it to registry for later use 
    protected function _initAppKeysToRegistry() { 

     $appkeys = new Zend_Config_Ini(APPLICATION_PATH . '/configs/appkeys.ini'); 
     Zend_Registry::set('keys', $appkeys); 
    } 

} 

appkeys.ini

; facebook and twitter app keys obtained after registering your app 
; with these two websites. 

facebook.appid = YOUR_FACEBOOK_APPID 
facebook.secret = YOUR_FACEBOOK_SECRET 
facebook.redirecturi = http://url.of.your.app/ 
facebook.scope = 'email' 

twitter.appid = YOUR_TWITTER_APPID 
twitter.secret = YOUR_TWITTER_SECRET 
twitter.redirecturi = http://url.of.your.app/ 
+0

我研究過那個,我創建了一個沒有bootstrap和ini文件的登錄形式的例子...那麼爲什麼我們需要這些文件並給我一次例子? – kiran 2011-02-23 08:18:36

+0

@kiran。你研究過哪一個沒有Bootsrap.php和ini文件? – Marcin 2011-02-23 08:22:39

+0

是的,我們有,但問題是爲什麼我們應該使用該文件沒有該文件也exmaple運行.. – kiran 2011-02-23 13:49:12

相關問題