2010年3月12日星期五

Re: [fw-mvc] Form DisplayGroup inside tabs

I have find a solution with Zend_Dojo_Form:

class MyForm extends Zend_Dojo_Form ...

... after all elements created ...


// Whole form insite a tabcontainer and <dl class="zend_form"> tag...
$this->setDecorators(array(
'FormElements',
array('TabContainer',array('design' => 'headline',
'style'=>'height:600px; width:100%', 'id' => 'form-tab-container')),
array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
'Form',
));

// Every displaygroup inside contentpane
$this->setDisplayGroupDecorators(array(
'FormElements',
'Fieldset',
array('ContentPane', array('region' => 'top', 'style' =>
'background-color: white; padding: 10px')),
));

Maybe I'm missing something... but it works perfectly...

Of course, you must put "submit" (and any other button) inside every
displaygroup.

Il giorno 03/mar/10, alle ore 14:49, Bart McLeod ha scritto:

> but then you can't use Dojo, it is wether Dojo or jQuery, not both
> at the same time...
> But then, I prefer jQuery anyway
>
> -Bart
>
> Jurian Sluiman schreef:
>>
>> On Wednesday 03 Mar 2010 10:37:02 Emanuele Deserti wrote:
>>
>>> Hi to all,
>>>
>>> it's possible to configure a Zend_Form object for display all
>>> displaygroup inside different tabs (using tabContainer and
>>> contentPane
>>> of Zend_Dojo)?
>>>
>>> One displaygroup = one tabs
>>> Submit and Reset button = OUTSIDE the TabContainer OR in ALL tabs...
>>>
>>> There is a "simple" way or I need custom decorators and custom code?
>>>
>>> Thanks in advance
>>>
>>
>> The ZendX_JQuery package provides tabbed forms by using the
>> ZendX_JQuery_Form
>> instance. It loads a form with a TabContainer decorator and you can
>> add
>> multiple form instances with the TabPane decorator.
>>
>> The complete howto is at the manual:
>> http://framework.zend.com/manual/en/zendx.jquery.form.html
>>
>> Regards, Jurian
>>
>
> --
> Bart McLeod
> Space Web
> Middenlaan 47
> 6865 VN Heveadorp
> The Netherlands
> t +31(0)26 3392952
> m 06 51 51 89 71
> @ info@spaceweb.nl
> www.spaceweb.nl
> <zce_logo.gif><php5-zce-logo-new.gif> <zf-zce-logo.gif>
> Bart McLeod is a Zend Certified Engineer.
>
> Click to verify!
>
> <logo_230.gif>

---
Emanuele Deserti
Netwing S.r.l.
<emanuele.deserti@netwing.it>
Tel.: 0532 - 1912002
http://www.netwing.it

Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Jelle-Jan is completely right about this. I also inspected the code an found that the form uses post, not get. This doesn't really matter, since a redirect is performed. Like he said, it is easy to accomplish this following his example.

Regards,

Bart McLeod

Op 11-3-2010 16:36, Jelle-Jan van Veelen - Zicht schreef:
When you inspect the response headers after submitting a search form, you will see that the forms are posted to a search router (/tracks/search_router). There is probably some logic in that controller/action that takes the posted values and redirects the browser to another page, depending on what the keys in the postbody are. You could easily build that with Zend Framework too, it is just a matter of checking for POST values and redirect to your own URL's :)

So, something like this:
class TracksController extends Zend_Controller_Action {
 
    public function searchAction() {
        if ($this->getRequest()->getParam('artist') {
            // search for artist here
        }
       
        if ($this->getRequest()->getParam('title') {
            // search for title here
        }
    }
 
    public function searchRouterAction() {
        $values = $this->getRequest()->getPost();
       
        if (isset($values['artist'])) {
            $this->_redirect(sprintf('/tracks/search/artist/%s', $values['artist']));
            exit();
        }
       
        if (isset($values['title'])) {
            $this->_redirect(sprintf('/tracks/search/title/%s', $values['title']));
            exit();
        }
    }
}

Regards,
Jelle-Jan

On 11-3-2010 16:20, Andy Daykin wrote:
Take for example this site http://www.musicbackingtracks.co.uk/tracks/search/artist/creed, I just picked a site build with codeigniter, that has a search form. The parameter is artist, with a value of creed. They are able to get nice looking url's with search forms, that's what I am really looking for. SEO is the main concern that I have, it's not really about looking good in a browser.
 
-Andy

Sent: Tuesday, March 09, 2010 5:08 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

in your view script, where you use the helper.

The url in the browser will only look like this after you click the link generated by the view helper.

Is it only about a good looking url in the browser? The get request from a search form for example will still have the question mark. But I cannot see the problem with that.

Bart


Op 8-3-2010 19:24, Andy Daykin schreef:
So where in my code would I put:
 
$url = $view->url($_GET)
 
Is that something that should be added in the bootstrap. Will the actual url in the browser look like
http://example.com/controller/action/param/value
?
 
Thanks,
 
-Andy

Sent: Monday, March 08, 2010 6:18 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Hi Andy,

I probably posted to the wrong list, so you may have missed it. I set out to fix a couple of issues with the Zend_View_Helper_Url.

No one objected to that, so I also filed your issue in the issue tracker and assigned it to myself.

I did not yet look into it much, but it seems that how the url is assembled in the view helper  depends on which type of router is in use at that moment.

There a quite a few router types, so I must first choose if all routers can be made to preserve get parameters in the new form and if this will brake people's applications if they rely on the helper not preserving the get params.

In the meanwhile, while trying to write up a testcase for Zend_View_Helper_Url, I found that what you are trying to achieve can be simply accomplished by writing:

$url = $view->url($_GET);

This will put all of your $_GET parameters in the form you desire.

I accidentally stumbled upon this and I now realize that I must update the issue and resolve it with this tip.

Regards,

Bart McLeod

Andy Daykin schreef:
My intent was to find a way to change the part of the code where the get variables are picked up, so I can do:
 
$this->getRequest()->getParam('param');
 
 
 
using something like $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI']));
 
So I would be manipulating the url that comes in and the variable from where the getParam method takes in the get parameters.
 
What variables would I need to change if I wrote a function in the bootstrap?
 
-Andy

Sent: Wednesday, March 03, 2010 3:34 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Guys, it's not just for better looking urls.

There is another problem with  /controller/action?param=value, url helper don't see get parameters, it only see parametersif they are zf style, so param will not be handled by url helper if it is not in zf param style.

People coming up with their own implementations for url helper which handles this, example http://robertbasic.com/blog/myurl-view-helper-for-zend-framework/


Regards,
Saša Stamenković


On Wed, Mar 3, 2010 at 10:03 AM, Bart McLeod <mcleod@spaceweb.nl> wrote:


David Muir schreef:
That would only be necessary if the desired form were actually required.  Zend's default router sees them as being equivalent: /controller/action/param/value /controller/action?param=value  so in both cases $this->getRequest()->getParam('param'); //returns 'value'  However, if you're wanting something like: /search/value   
For this, you only need a custom route. No extra rewrite.
The point in the original post is that for some unknown reason the get url should be consistent with the other urls in the application.
So the question is how can we make /controller/action?param=value appear as /controller/action/param/value
But the more important question, as pointed out by Andreas is "Why?"

then yes, you'll need to do the rewrite server-side.      

--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!



--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!


--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!


--
Zicht online
Coolhaven 238, 3024 AP Rotterdam
telefoon: 010 221 02 00
e-mail: jellejan@zicht.nl
www: www.zicht.nl
KvK: 27 19 33 76

Het laatste nieuws van Zicht:
Robeco Zomerconcerten platform 2010 live

De laatste post op de Zicht blog:
Bloed Oranje


--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!

2010年3月11日星期四

Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

When you inspect the response headers after submitting a search form, you will see that the forms are posted to a search router (/tracks/search_router). There is probably some logic in that controller/action that takes the posted values and redirects the browser to another page, depending on what the keys in the postbody are. You could easily build that with Zend Framework too, it is just a matter of checking for POST values and redirect to your own URL's :)

So, something like this:
class TracksController extends Zend_Controller_Action {
 
    public function searchAction() {
        if ($this->getRequest()->getParam('artist') {
            // search for artist here
        }
       
        if ($this->getRequest()->getParam('title') {
            // search for title here
        }
    }
 
    public function searchRouterAction() {
        $values = $this->getRequest()->getPost();
       
        if (isset($values['artist'])) {
            $this->_redirect(sprintf('/tracks/search/artist/%s', $values['artist']));
            exit();
        }
       
        if (isset($values['title'])) {
            $this->_redirect(sprintf('/tracks/search/title/%s', $values['title']));
            exit();
        }
    }
}

Regards,
Jelle-Jan

On 11-3-2010 16:20, Andy Daykin wrote:
Take for example this site http://www.musicbackingtracks.co.uk/tracks/search/artist/creed, I just picked a site build with codeigniter, that has a search form. The parameter is artist, with a value of creed. They are able to get nice looking url's with search forms, that's what I am really looking for. SEO is the main concern that I have, it's not really about looking good in a browser.
 
-Andy

Sent: Tuesday, March 09, 2010 5:08 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

in your view script, where you use the helper.

The url in the browser will only look like this after you click the link generated by the view helper.

Is it only about a good looking url in the browser? The get request from a search form for example will still have the question mark. But I cannot see the problem with that.

Bart


Op 8-3-2010 19:24, Andy Daykin schreef:
So where in my code would I put:
 
$url = $view->url($_GET)
 
Is that something that should be added in the bootstrap. Will the actual url in the browser look like
http://example.com/controller/action/param/value
?
 
Thanks,
 
-Andy

Sent: Monday, March 08, 2010 6:18 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Hi Andy,

I probably posted to the wrong list, so you may have missed it. I set out to fix a couple of issues with the Zend_View_Helper_Url.

No one objected to that, so I also filed your issue in the issue tracker and assigned it to myself.

I did not yet look into it much, but it seems that how the url is assembled in the view helper  depends on which type of router is in use at that moment.

There a quite a few router types, so I must first choose if all routers can be made to preserve get parameters in the new form and if this will brake people's applications if they rely on the helper not preserving the get params.

In the meanwhile, while trying to write up a testcase for Zend_View_Helper_Url, I found that what you are trying to achieve can be simply accomplished by writing:

$url = $view->url($_GET);

This will put all of your $_GET parameters in the form you desire.

I accidentally stumbled upon this and I now realize that I must update the issue and resolve it with this tip.

Regards,

Bart McLeod

Andy Daykin schreef:
My intent was to find a way to change the part of the code where the get variables are picked up, so I can do:
 
$this->getRequest()->getParam('param');
 
 
 
using something like $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI']));
 
So I would be manipulating the url that comes in and the variable from where the getParam method takes in the get parameters.
 
What variables would I need to change if I wrote a function in the bootstrap?
 
-Andy

Sent: Wednesday, March 03, 2010 3:34 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Guys, it's not just for better looking urls.

There is another problem with  /controller/action?param=value, url helper don't see get parameters, it only see parametersif they are zf style, so param will not be handled by url helper if it is not in zf param style.

People coming up with their own implementations for url helper which handles this, example http://robertbasic.com/blog/myurl-view-helper-for-zend-framework/


Regards,
Saša Stamenković


On Wed, Mar 3, 2010 at 10:03 AM, Bart McLeod <mcleod@spaceweb.nl> wrote:


David Muir schreef:
That would only be necessary if the desired form were actually required.  Zend's default router sees them as being equivalent: /controller/action/param/value /controller/action?param=value  so in both cases $this->getRequest()->getParam('param'); //returns 'value'  However, if you're wanting something like: /search/value   
For this, you only need a custom route. No extra rewrite.
The point in the original post is that for some unknown reason the get url should be consistent with the other urls in the application.
So the question is how can we make /controller/action?param=value appear as /controller/action/param/value
But the more important question, as pointed out by Andreas is "Why?"

then yes, you'll need to do the rewrite server-side.      

--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!



--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!


--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!


--
Zicht online
Coolhaven 238, 3024 AP Rotterdam
telefoon: 010 221 02 00
e-mail: jellejan@zicht.nl
www: www.zicht.nl
KvK: 27 19 33 76

Het laatste nieuws van Zicht:
Robeco Zomerconcerten platform 2010 live

De laatste post op de Zicht blog:
Bloed Oranje

Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Take for example this site http://www.musicbackingtracks.co.uk/tracks/search/artist/creed, I just picked a site build with codeigniter, that has a search form. The parameter is artist, with a value of creed. They are able to get nice looking url's with search forms, that's what I am really looking for. SEO is the main concern that I have, it's not really about looking good in a browser.
 
-Andy

Sent: Tuesday, March 09, 2010 5:08 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

in your view script, where you use the helper.

The url in the browser will only look like this after you click the link generated by the view helper.

Is it only about a good looking url in the browser? The get request from a search form for example will still have the question mark. But I cannot see the problem with that.

Bart


Op 8-3-2010 19:24, Andy Daykin schreef:
So where in my code would I put:
 
$url = $view->url($_GET)
 
Is that something that should be added in the bootstrap. Will the actual url in the browser look like
http://example.com/controller/action/param/value
?
 
Thanks,
 
-Andy

Sent: Monday, March 08, 2010 6:18 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Hi Andy,

I probably posted to the wrong list, so you may have missed it. I set out to fix a couple of issues with the Zend_View_Helper_Url.

No one objected to that, so I also filed your issue in the issue tracker and assigned it to myself.

I did not yet look into it much, but it seems that how the url is assembled in the view helper  depends on which type of router is in use at that moment.

There a quite a few router types, so I must first choose if all routers can be made to preserve get parameters in the new form and if this will brake people's applications if they rely on the helper not preserving the get params.

In the meanwhile, while trying to write up a testcase for Zend_View_Helper_Url, I found that what you are trying to achieve can be simply accomplished by writing:

$url = $view->url($_GET);

This will put all of your $_GET parameters in the form you desire.

I accidentally stumbled upon this and I now realize that I must update the issue and resolve it with this tip.

Regards,

Bart McLeod

Andy Daykin schreef:
My intent was to find a way to change the part of the code where the get variables are picked up, so I can do:
 
$this->getRequest()->getParam('param');
 
 
 
using something like $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI']));
 
So I would be manipulating the url that comes in and the variable from where the getParam method takes in the get parameters.
 
What variables would I need to change if I wrote a function in the bootstrap?
 
-Andy

Sent: Wednesday, March 03, 2010 3:34 AM
Subject: Re: [fw-mvc] Re: Changing get parameters to controller/action/param/value/param/value

Guys, it's not just for better looking urls.

There is another problem with  /controller/action?param=value, url helper don't see get parameters, it only see parametersif they are zf style, so param will not be handled by url helper if it is not in zf param style.

People coming up with their own implementations for url helper which handles this, example http://robertbasic.com/blog/myurl-view-helper-for-zend-framework/


Regards,
Saša Stamenković


On Wed, Mar 3, 2010 at 10:03 AM, Bart McLeod <mcleod@spaceweb.nl> wrote:


David Muir schreef:
That would only be necessary if the desired form were actually required.  Zend's default router sees them as being equivalent: /controller/action/param/value /controller/action?param=value  so in both cases $this->getRequest()->getParam('param'); //returns 'value'  However, if you're wanting something like: /search/value   
For this, you only need a custom route. No extra rewrite.
The point in the original post is that for some unknown reason the get url should be consistent with the other urls in the application.
So the question is how can we make /controller/action?param=value appear as /controller/action/param/value
But the more important question, as pointed out by Andreas is "Why?"

then yes, you'll need to do the rewrite server-side.      

--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!



--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!


--
Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ info@spaceweb.nl
www.spaceweb.nl
zce logozce PHP 5 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!

2010年3月10日星期三

[fw-auth] Zend's Acl Role not clear

Hi,

I am totally new with Zend Framework, Php and also stepping new in the proffessional life, so don't mind if my questions seems silly to you.

I am following the Zend Tutorials on youtube by alexander;

http://www.youtube.com/watch?v=6vhxo2oL70E


This is the error i'm getting on my page for the ROLE variable when i'm running my code:

Notice: Trying to get property of non-object in C:\wamp\www\ZCF_Documents\application\plugins\AccessCheck.php  on line 18

As far as I know, this error is when Zend doesn't find the mentioned variable in the code or it is not transferred to the calling code properly. But what I want to inquire is that why are you not getting this error and I am. I have followed your tutorial, still the ROLE in my code doesn't seem to transfer at all. I inquire the reason and want to know what is it that I am missing??? may be my concepts with Zend variables in ACL coding are not clear enough...Help needed please.


----------<<<<<<<<>>>>>>>>>--------------
this is my AccessCheck.php code:
----------<<<<<<<<>>>>>>>>>--------------

<?php
class Plugin_AccessCheck extends Zend_Controller_Plugin_Abstract {

    private $_acl= null;
    private $_auth = null;

    public function __construct(Zend_Acl $acl, Zend_Auth $auth) {
        $this->_acl=$acl;
        $this->_auth=$auth;
    }

    public function preDispatch(Zend_Controller_Request_Abstract $request) {

        $resource = $request->getControllerName();
        $action = $request->getActionName();

        $auth_all_items_stored = $this->_auth->getStorage()->read();
        $role = $auth_all_items_stored->role;

        if(!$this->_acl->isAllowed($role, $resource, $action)) {

            $request->setControllerName('authentication')
                ->setActionName('login');
        }
    }
}



----------<<<<<<<<>>>>>>>>>--------------
My Model code:
----------<<<<<<<<>>>>>>>>>--------------

<?php

class Model_Authentication_User extends Zend_Acl {
    protected $_name = 'user';

    public function __construct() {
        $this->add(new Zend_Acl_Resource('index'));
        $this->add(new Zend_Acl_Resource('authentication'));

        $this->add(new Zend_Acl_Resource('documents'));
        $this->add(new Zend_Acl_Resource('edit'),'documents');
        $this->add(new Zend_Acl_Resource('add'),'documents');
        $this->add(new Zend_Acl_Resource('list'),'documents');

//        $this->add(new Zend_Acl_Resource('docs'));
//        $this->add(new Zend_Acl_Resource('list'),'docs');

        $this->addRole(new Zend_Acl_Role('user'));
        $this->addRole(new Zend_Acl_Role('admin'),'user');

        $this->allow('user','index');
        $this->allow('user','documents');
        $this->allow('user','authentication');
        $this->allow('user','documents','list');
        $this->allow('admin','documents','list');
        $this->allow('admin','documents','edit');
        $this->allow('admin','documents','add');
    }
}

----------<<<<<<<<>>>>>>>>>--------------
this is my Controller code:
----------<<<<<<<<>>>>>>>>>--------------

class AuthenticationController extends Zend_Controller_Action {

public function loginAction() {

        if(Zend_Auth::getInstance()->hasIdentity()) {
            echo 'asg';
            $this->_redirect('authentication/index');
        }
        $req = $this->getRequest();

        $form = new Form_LoginPage();
       
        if($req->isPost()) {
            if($form->isValid($this->_request->getPost())) {

                $AuthentAdapter = $this->getAuthAdapter();

                $user_name = $form->getValue('username');
                $user_password = $form->getValue('userpassword');

                $AuthentAdapter ->setIdentity($user_name)
                    ->setCredential($user_password);

                $auth=Zend_Auth::getInstance();

                $result = $auth->authenticate($AuthentAdapter);

                if($result->isValid()) {
                    $identity=$AuthentAdapter->getResultRowObject();
                    $authStorage = $auth->getStorage();
                    $authStorage->write($identity);

                    $this->_redirect('Documents/list');
                }
                else
                    $this->view->errorMessage = 'Invalid User name or Password provided, try again';
            }
        }
        $this->view->form = $form;
}



   private function getAuthAdapter() {


        $AuthentAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());

        $AuthentAdapter->setTableName('user')
            ->setIdentityColumn('user_name')
            ->setCredentialColumn('user_password');
        return $AuthentAdapter;
      }
}

[fw-mvc] Re: Zend_Navigation noob question

You should add Zend_Navigation to your view:

$view = Zend_Layout::getMvcInstance()->getView();
$view->navigation($navigation);

Laura Dean wrote:
>
> It seems like between Jon Lebensold's Zendcast and the ZF docs I should be
> able to figure out how to set up Zend_Navigation, but I am still missing
> something...
>
> Is there a way to set it up without using the bootstrap.php file? I have
> the following in my init.php:
>
> /**
> * Layout helper
> */
> Zend_Layout::startMvc();
>
> /**
> * Navigation helper
> */
> $xml = new Zend_Config_Xml($config->framework->config_dir .
> '/navigation.xml', 'nav');
> $navigation = new Zend_Navigation($xml);
>
> And in my layout.phtml, I want to display it using this:
>
> <? $this->navigation()->menu(); ?>
>
> So it looks like the part I am missing is how to add "$navigation" to the
> view, but the view variable isn't currently used anywhere in index.php and
> I'm just not sure how it gets initialized or if I have access to it from
> there.
>
> I also don't understand how I need to modify my index.php to load the
> "_init" functions from bootstrap.php. I assume it will look like
> $bootstrap = something ... but I'm not sure what that something is and I'm
> having a hard time finding it for some reason.
>
>

--
View this message in context: http://n4.nabble.com/Zend-Navigation-noob-question-tp1583090p1587612.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年3月9日星期二

[fw-mvc] Re: [fw-general] Validator not working

thanks all for helping.
There were just a view typo's.

tnx

On Tue, Mar 9, 2010 at 4:21 PM, Ever Daniel Barreto Rojas <everdaniel@gmail.com> wrote:
Hey Jigal,

2010/3/9 Jigal sanders <jigalroecha@gmail.com>:
> I am trying to get my UniqueEmail validator working but it seems that my
> validator is never triggered.

not sure if you already saw it but you have this:

$currentUser = isset($context['usr_id']) ?
$this->_model->getUserById($context['user_id']) : null;

make note how you use usr_id first and later user_id (note the e in
user), thought, I'm not sure if they are meant to be different...

---
Ever Daniel Barreto Rojas
everdaniel at gmail dot com
www.everdaniel.com



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489