Re: [fw-general] view helpers within a view helper

2009-09-09 Thread neobeacon

Thanks for all.
yes I also think that this way is inefficient.I should use join for this
purpose,Thanks again for all 
-- 
View this message in context: 
http://www.nabble.com/view-helpers-within-a-view-helper-tp25351769p25368712.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] view helpers within a view helper

2009-09-09 Thread mandi
And I think you should consider using the Models (DbTable) and not the
Helpers for those operations.

rgds
Armand


> 
> neobeacon wrote:
>> I create a view helper to show comments for a article.(by getting
>> article_id
>> from comments table and using foreach to get each comment).
>> 
>> But in comment table only has commentator's id.
>> 
>> I used a view helper to convert user_id to get the user name.
>> 
>> With in a view helper can I call another view helper?
>> 
>> How do I handle this  case?
>>


Re: [fw-general] view helpers within a view helper

2009-09-09 Thread Nick Pack
You should really use a join query for this, so that the comment 
resultset has all the info available already in it, the way you are 
doing it is quite inefficient


neobeacon wrote:

I create a view helper to show comments for a article.(by getting article_id
from comments table and using foreach to get each comment).

But in comment table only has commentator's id.

I used a view helper to convert user_id to get the user name.

With in a view helper can I call another view helper?

How do I handle this  case?





Re: [fw-general] view helpers within a view helper

2009-09-08 Thread neobeacon

=)Thanks
-- 
View this message in context: 
http://www.nabble.com/view-helpers-within-a-view-helper-tp25351769p25352263.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] view helpers within a view helper

2009-09-08 Thread Hector Virgen
If you extend Zend_View_Abstract, your view helper will have the view set as
the $view property of the class, allowing you to call other helpers like
this:
$this->view->someOtherHelper();

Or, you can add your own setView() method

public function setView(Zend_View_Interface $view)
{
$this->view = $view;
}

Take a look at this page for more information:

http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.custom

--
Hector


On Tue, Sep 8, 2009 at 11:36 AM, neobeacon  wrote:

>
> I create a view helper to show comments for a article.(by getting
> article_id
> from comments table and using foreach to get each comment).
>
> But in comment table only has commentator's id.
>
> I used a view helper to convert user_id to get the user name.
>
> With in a view helper can I call another view helper?
>
> How do I handle this  case?
>
> --
> View this message in context:
> http://www.nabble.com/view-helpers-within-a-view-helper-tp25351769p25351769.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


[fw-general] view helpers within a view helper

2009-09-08 Thread neobeacon

I create a view helper to show comments for a article.(by getting article_id
from comments table and using foreach to get each comment).

But in comment table only has commentator's id.

I used a view helper to convert user_id to get the user name.

With in a view helper can I call another view helper?

How do I handle this  case?

-- 
View this message in context: 
http://www.nabble.com/view-helpers-within-a-view-helper-tp25351769p25351769.html
Sent from the Zend Framework mailing list archive at Nabble.com.