Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-03 Thread Jason Webster
The URL action helper is much more robust in its functionality than the 
view helper.

To get an interface exactly the same as the view helper, use

$this->_helper->url->url(array(), 'routename', false);


Rolando Espinoza La Fuente wrote:

On Tue, Dec 2, 2008 at 3:06 AM, Cameron <[EMAIL PROTECTED]> wrote:
  

Hi guys,

The subject line sums it all up. I do some URL generation in the controller
/ model (form submission URLs and so on), and I'd love to be able to use the
same url View Helper that has proven so wonderful in my Views. What's the
trick? I'm sure it's something simple that I'm not smart enough to have
guessed.



Have you tried the url action helper?

 $thils->_helper->url($action, $controller);

Cheers,

  




Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Rolando Espinoza La Fuente
On Tue, Dec 2, 2008 at 3:06 AM, Cameron <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> The subject line sums it all up. I do some URL generation in the controller
> / model (form submission URLs and so on), and I'd love to be able to use the
> same url View Helper that has proven so wonderful in my Views. What's the
> trick? I'm sure it's something simple that I'm not smart enough to have
> guessed.

Have you tried the url action helper?

 $thils->_helper->url($action, $controller);

Cheers,

-- 
Rolando Espinoza La fuente


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Graham Anderson
On Tuesday 02 December 2008 08:06:52 Cameron wrote:
>Hi guys,
>
>The subject line sums it all up. I do some URL generation in the controller
>/ model (form submission URLs and so on), and I'd love to be able to use the
>same url View Helper that has proven so wonderful in my Views. What's the
>trick? I'm sure it's something simple that I'm not smart enough to have
>guessed.

There's a controller action helper that provides the same functionality, plus 
a little more.

http://framework.zend.com/apidoc/core/Zend_Controller/Zend_Controller_Action_Helper/Zend_Controller_Action_Helper_Url.html


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

*MVC police arriving*

Use the url action helper, it works exacly like the url view helper.
Also the view helper may output html-escaped in the future, so you
shouldn't rely on this. And yes, the assembly method may change
completly with 2.0.

$this->_helper->url();

Ben
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::


monk.e.boy schrieb:
> 
> 
> Themselves wrote:
>> What's the trick?
>>
> 
> In your controller -> action:
> 
> $tmp = $this->view->url( array( 'controller'=>'moo' ) );
> 
> Try that.
> 
> This kinda breaks the MVC, so be prepared for the MVC police ;-)
> 
> monk.e.boy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk0/KIACgkQ0HfT5Ws789CqngCeKprkbOEoMZa4pCqqebGmB1F5
ZEYAoLz6CyU+ZIg7pvpBdVa4M5Qygr5u
=sw4C
-END PGP SIGNATURE-


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread monk.e.boy



Themselves wrote:
> 
> What's the trick?
> 

In your controller -> action:

$tmp = $this->view->url( array( 'controller'=>'moo' ) );

Try that.

This kinda breaks the MVC, so be prepared for the MVC police ;-)

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/-Dumb-Question--How-do-I-use-the-URL-view-helper-in-my-controllers--tp20787141p20788535.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread keith Pope
I very much doubt that the routers assemble interface will change, if
it does ZF will definitely announce it as a BC breaking change.

2008/12/2 Cameron <[EMAIL PROTECTED]>:
> well i thought about that, and that's a very simple solution (because the
> code in the url helper is very simple), but that internal interface might
> change in later revisions of the framework, so i thought i'd see about doing
> it the "right" way :P
>
> On Tue, Dec 2, 2008 at 5:21 PM, keith Pope <[EMAIL PROTECTED]> wrote:
>>
>> I would have a look inside the view url helper and maybe create an
>> action helper that does the same?
>>
>> 2008/12/2 Cameron <[EMAIL PROTECTED]>:
>> > Hi guys,
>> >
>> > The subject line sums it all up. I do some URL generation in the
>> > controller
>> > / model (form submission URLs and so on), and I'd love to be able to use
>> > the
>> > same url View Helper that has proven so wonderful in my Views. What's
>> > the
>> > trick? I'm sure it's something simple that I'm not smart enough to have
>> > guessed.
>> >
>>
>>
>>
>> --
>> --
>> [MuTe]
>> --
>
>



-- 
--
[MuTe]
--


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Cameron
well i thought about that, and that's a very simple solution (because the
code in the url helper is very simple), but that internal interface might
change in later revisions of the framework, so i thought i'd see about doing
it the "right" way :P

On Tue, Dec 2, 2008 at 5:21 PM, keith Pope <[EMAIL PROTECTED]> wrote:

> I would have a look inside the view url helper and maybe create an
> action helper that does the same?
>
> 2008/12/2 Cameron <[EMAIL PROTECTED]>:
> > Hi guys,
> >
> > The subject line sums it all up. I do some URL generation in the
> controller
> > / model (form submission URLs and so on), and I'd love to be able to use
> the
> > same url View Helper that has proven so wonderful in my Views. What's the
> > trick? I'm sure it's something simple that I'm not smart enough to have
> > guessed.
> >
>
>
>
> --
> --
> [MuTe]
> --
>


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread keith Pope
I would have a look inside the view url helper and maybe create an
action helper that does the same?

2008/12/2 Cameron <[EMAIL PROTECTED]>:
> Hi guys,
>
> The subject line sums it all up. I do some URL generation in the controller
> / model (form submission URLs and so on), and I'd love to be able to use the
> same url View Helper that has proven so wonderful in my Views. What's the
> trick? I'm sure it's something simple that I'm not smart enough to have
> guessed.
>



-- 
--
[MuTe]
--


[fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-01 Thread Cameron
Hi guys,

The subject line sums it all up. I do some URL generation in the controller
/ model (form submission URLs and so on), and I'd love to be able to use the
same url View Helper that has proven so wonderful in my Views. What's the
trick? I'm sure it's something simple that I'm not smart enough to have
guessed.