2010年2月21日星期日

[fw-mvc] Re: How to extend Zend_View?

In fact, instead of removing "resources.view[] =", since some view
configurations may be needed sometimes I guess, I override _bootstrap() in
my bootstrap, to be able to set my own view after the ressources are loaded:

------------------------

protected function _bootstrap($resource = null)
{
parent::_bootstrap($resource);

$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$view = new My_View();
$viewRenderer->setView($view);
}

------------------------

This works great...
--
View this message in context: http://n4.nabble.com/How-to-extend-Zend-View-tp1563653p1563765.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Re: How to extend Zend_View?

That didn't help either... But I debuged the code and I found the problem:

In my application.ini, there was this line:

resources.view[] =

And this line made this method to be called (because of "ressources
loading"):

Zend_Application_Resource_View::init()

which creates an hardcoded Zend_View inside:

$view = $this->getView();

And this Zend_View is then set inside the also created
Zend_Controller_Action_Helper_ViewRenderer which is pushed in the
Zend_Controller_Action_HelperBroker. And this replaces my own
Zend_Controller_Action_Helper_ViewRenderer.

The problem is that the ressources loading is made after the call to my
_initApp() function inside the bootstrap.

So just by removeing that line in "application.ini", everything seams to run
smooth now.

Thanks for the help!


--
View this message in context: http://n4.nabble.com/How-to-extend-Zend-View-tp1563653p1563738.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Re: How to extend Zend_View?

Try replacing your bootstrap code with this:

$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$view = new My_View();
$viewRenderer->setView($view);

--
Hector


On Sun, Feb 21, 2010 at 11:02 AM, electrotype <electrotype@gmail.com> wrote:

Thanks but that doesn't help me!

I understand the concept of Zend_View extending Zend_View_Abstract.. What I
don't understand is how to globally replace the use of Zend_View by my own
extending class.


--
View this message in context: http://n4.nabble.com/How-to-extend-Zend-View-tp1563653p1563696.html
Sent from the Zend MVC mailing list archive at Nabble.com.


[fw-mvc] Re: How to extend Zend_View?

Thanks but that doesn't help me!

I understand the concept of Zend_View extending Zend_View_Abstract.. What I
don't understand is how to globally replace the use of Zend_View by my own
extending class.


--
View this message in context: http://n4.nabble.com/How-to-extend-Zend-View-tp1563653p1563696.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] How to extend Zend_View?

You should take a look to the documentation:

http://framework.zend.com/manual/en/zend.view.abstract.html

--
Regards,

Pieter Kokx
PHP Developer
Zend Framework developer

electrotype schreef:
> I try to extend Zend_View. I know I could create helpers but I would prefere
> to really extend Zend_View in my application.
>
> I tried what's suggested
> http://sandhillcreative.com/kb/2009/04/29/extending-zend-view-to-implement-a-concrete-function/
> here , but without success.
>
> My class:
> ---------------------------------
> My_View extends Zend_View
> {
> //...
> }
> --------------------------------
>
> In my application bootstrap _init function:
>
> --------------------------------
> $view = new My_View();
> $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
> $viewRenderer->setView($view);
> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
> --------------------------------
>
> But when the code reaches a view script, let's say index.phtml, "$this" is
> an instance of Zend_View, not of My_View!
>
> I'm very new to the Zend Framework. I started my test application from the "
> http://framework.zend.com/manual/en/learning.quickstart.intro.html quick
> start " demo.
>
>
> Can someone help?
>
> Thanks in advance!
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

[fw-mvc] How to extend Zend_View?

I try to extend Zend_View. I know I could create helpers but I would prefere
to really extend Zend_View in my application.

I tried what's suggested
http://sandhillcreative.com/kb/2009/04/29/extending-zend-view-to-implement-a-concrete-function/
here , but without success.

My class:
---------------------------------
My_View extends Zend_View
{
//...
}
--------------------------------

In my application bootstrap _init function:

--------------------------------
$view = new My_View();
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
--------------------------------

But when the code reaches a view script, let's say index.phtml, "$this" is
an instance of Zend_View, not of My_View!

I'm very new to the Zend Framework. I started my test application from the "
http://framework.zend.com/manual/en/learning.quickstart.intro.html quick
start " demo.


Can someone help?

Thanks in advance!

--
View this message in context: http://n4.nabble.com/How-to-extend-Zend-View-tp1563653p1563653.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年2月19日星期五

Re: [fw-db] Re: Something fishy with adapters in Zend_Db

We have not tried to produce a PDO_Informix adapter to my knowledge, as
the demand in the past has not been high at all.

After producing a working adapter, you might want to try to see if the
unit tests will run on the adapter. I've done this with Pdo_Odbc (with
unixODBC) and realized there are too many features missing in unixODBC,
and too many failing unit tests to include it in the framework.

Overall, I am not sure what the demand is for an Informix adapter, it
would be interesting to find out though :)

-ralph

chris.de wrote:
> Hi,
>
> i also stumbled upon the "special" design of the Zend_Db_Adapter_Pdo_Ibm
> adapter.
>
> We would also like to have a Zend_Db_Adapter_Pdo_Informix adapter, which
> could use pdo_informix.
>
> See also a post from our database administrator
> http://n4.nabble.com/PDO-INFORMIX-tp1559891p1559891.html
>
> The problem is that Zend_Db only works with pdo_ibm which forces us to
> install the DB2 Client and to use additional DRDA protocol. This leads to
> additional ports which have to be configured on each database server
> instance and in the firewalls.
>
> With the use of pdo_informix we could use the already configured connection
> parameters and no additional software installation would be necessary. This
> lowers the number of different components which have to be supported and
> could fail.
>
> We are thinking about building Zend_Db_Adapter_Pdo_Informix on our own.
> Are there already some drafts around?
> Is anybody else interested in Zend_Db_Adapter_Pdo_Informix, so we can sum up
> our efforts?
>
> Greetings
> Chris