+ Reply to Thread
Results 1 to 2 of 2

Thread: returning the value of a variable from controller to form or model..

  1. #1
    Chandra Prakash Pancholi is offline Junior Member
    Join Date
    Jun 2009
    Posts
    1

    Default returning the value of a variable from controller to form or model..

    hi everybody
    actually i am new to zend framework. I know that i can return a value of a variable from a form to the controller. Can I also return a value from the controller to any form or any model? If this is possible then please tell me that how can we do it.

    Thanks in advance.

  2. #2
    notrub225 is offline Senior Member
    Join Date
    Jan 2008
    Location
    chicago
    Posts
    107

    Default

    Well you can pass a variable from the Controller to the View:

    In the Controller:
    $this->view->foobar = "this is a string";


    In the corresponding View:
    <h1><?= $this->foobar ?></h1>

    will get you:
    <h1>this is a string</h1>

+ Reply to Thread

Similar Threads

  1. How to pass a variable to form?
    By risoknop in forum General Talks
    Replies: 6
    Last Post: 04-14-2010, 12:42 AM
  2. send variable from controller to zend_form
    By seth9009 in forum General Q&A on Zend Framework
    Replies: 3
    Last Post: 12-31-2009, 02:15 PM
  3. pass variable from db to form
    By AceWebDesign in forum General Q&A on Zend Framework
    Replies: 7
    Last Post: 10-24-2008, 10:32 PM
  4. set view variable after controller dispatch?
    By titzu in forum Model-View-Controller (MVC)
    Replies: 0
    Last Post: 09-08-2008, 06:42 PM
  5. Controller variable not showing up in View
    By otmtoy in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 07-05-2008, 01:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts