ViewResolver interface in PhpViewRenderer

8 views
Skip to first unread message

Marius Rugan

unread,
Jun 4, 2009, 4:32:48 AM6/4/09
to Photon Framework
Hi all,
if got reposted, i don't see it in discussions list and sent it almost
12 hrs ago


Hi
photon got from svn,

i'm getting an exception on a typecasted argument type in Page.php
(constructor)

function __construct (AppContext $ctx, WebRequest $request, UrlHandler
$handler, ViewResolver $viewResolver)

Catchable fatal error: Argument 4 passed to Page::__construct() must
be an instance of ViewResolver,
instance of PhpViewRenderer given,
called in /home/mrugan/www/photon/classes/photon/web/
PageControllerApp.php on line 74
and defined in /home/mrugan/www/photon/classes/photon/web/Page.php on
line 17

the bootstraper is the same as in the manual. (http://
www.photonframework.com/manual/ch03.html#d0e64)

further diging gets me to:

interface ViewResolver should be implemented by the PhpViewRenderer ?

function getView ($controller, $path) // in PhpViewRenderer
should be
function getView (Page $controller, $path)

think this should be it. otherwise it's cool. started digging in the
code :)

Alvaro can you post some lines regarding AOP code ? i'm a noob into
AOP and tryin' to pick up the concept you wrote.

tia
Marius Rugan

Marius Rugan

unread,
Jun 3, 2009, 4:32:25 PM6/3/09
to photon-f...@googlegroups.com
Hi
photon got from svn,

i'm getting an exception on a typecasted argument type in Page.php (constructor)

function __construct (AppContext $ctx, WebRequest $request, UrlHandler $handler, ViewResolver $viewResolver) {

Catchable fatal error: Argument 4 passed to Page::__construct() must be an instance of ViewResolver,
instance of PhpViewRenderer given,
called in /home/mrugan/www/photon/classes/photon/web/PageControllerApp.php on line 74
and defined in /home/mrugan/www/photon/classes/photon/web/Page.php on line 17

Alvaro Carrasco

unread,
Jun 5, 2009, 12:51:13 PM6/5/09
to Marius Rugan, Photon Framework
Hi Marius,

See below:

Marius Rugan wrote:
> Hi all,
> if got reposted, i don't see it in discussions list and sent it almost
> 12 hrs ago
>
>

Sorry, new members are moderated and we don't get a lot of messages to
this list. It took me a while to see that you had posted.

> Hi
> photon got from svn,
>
> i'm getting an exception on a typecasted argument type in Page.php
> (constructor)
>
> function __construct (AppContext $ctx, WebRequest $request, UrlHandler
> $handler, ViewResolver $viewResolver)
>
> Catchable fatal error: Argument 4 passed to Page::__construct() must
> be an instance of ViewResolver,
> instance of PhpViewRenderer given,
> called in /home/mrugan/www/photon/classes/photon/web/
> PageControllerApp.php on line 74
> and defined in /home/mrugan/www/photon/classes/photon/web/Page.php on
> line 17
>
> the bootstraper is the same as in the manual. (http://
> www.photonframework.com/manual/ch03.html#d0e64)
>
> further diging gets me to:
>
> interface ViewResolver should be implemented by the PhpViewRenderer ?
>
> function getView ($controller, $path) // in PhpViewRenderer
> should be
> function getView (Page $controller, $path)
>
> think this should be it. otherwise it's cool. started digging in the
> code :)
>

You're right, I'll fix it today or tomorrow when I get a chance. I don't
usually use the PhpViewRenderer very often (I usually use the more
powerful PTagViewRenderer) so I probably forgot to update it after some
changes. This weekend I'll work on some unit tests to prevent these
types of bugs.

> Alvaro can you post some lines regarding AOP code ? i'm a noob into
> AOP and tryin' to pick up the concept you wrote.
>

Sure, I'll try to post some of that tonight and maybe work some more on
the documentation.

> tia
> Marius Rugan
>

Thanks for checking photon out and reporting that issue.

Alvaro

alvaro

unread,
Jun 11, 2009, 12:13:09 AM6/11/09
to Photon Framework
I'm sorry about the delay. The PhpViewRenderer is fixed on the trunk.

I also added some examples to the manual that demonstrate some basic
AOP using the library:
http://www.photonframework.com/manual/ch06.html

Your feedback is very much appreciated.
Let me know if you run into any more issues or if you have comments or
questions.

Thanks,
Alvaro
Reply all
Reply to author
Forward
0 new messages