Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-13-2008, 01:37 PM
Junior Member
 
Join Date: Apr 2008
Location: Germany, Hamburg
Posts: 11
Default MVC and custom helpers

Hi @ all,

I'm pretty new to Zend Framework and played around a bit with it the last days. Zend Studio 6.0.1 therefor generated a simple base application. I added the following lines to index.php:

Code:
Zend_Loader::registerAutoload();
Zend_Layout::startMvc(array('layoutPath' => ROOT_PATH . '/views/scripts/layouts'));
Everything with a layout work fine. Now I want to write some custom helpers. I placed it in the view/helpers path. I could not work out, how I have name the helper files and classes to get it work. Who can give me a hint ? Lets say for example for a helper called linkTo.

Thanks in advance

Sebastian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-13-2008, 02:35 PM
Junior Member
 
Join Date: Nov 2007
Location: Elmshorn, Germany
Posts: 9
Send a message via ICQ to t-mow
Default

views/helpers/LinkTo.php:

PHP Code:
class Zend_View_Helper_LinkTo {
    public function 
linkTo() {
       
// your code here
    
}

in the view:
PHP Code:
echo $this->linkTo(); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-13-2008, 02:44 PM
Junior Member
 
Join Date: Apr 2008
Location: Germany, Hamburg
Posts: 11
Default

Ok, this must be a combination of names I didn't try before. Now it works. Thanks a lot for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:21 PM.