From: Dan T. <da...@an...> - 2006-05-02 08:05:36
|
Hi Kevin, I have put some examples up on rendering other views, executing other action, and howto redirect... Its in an updated tarball on the same location /vc.tar :) Regarding routing it was to control parameters and url layout... In rails you do something like: map.connect 'profiles/:username', :controller =3D> 'profile', :action =3D= > 'view' I could easily implement something similar, as I've said in my two earlier posts, this is just coded as proof-of-concept but it should be fairly easy to make it fully usable... Here goes examples for redirection as you requested... Sorry for the long copy paste following: function red_string() { $this->redirect('/article/view/14231'); } function red_array() { $this->redirect( array( 'controller' =3D> 'article', 'action' =3D> 'view', 'id' =3D> '43223' ) ); } function view_render() { $this->some_var =3D "some var from other businness logic, id=3D" . $this->get['id']; $this->someitems =3D array( 'test other 1', 'test other 2', 'test other 3', 'test other 4' ); $this->render('/article/view'); } function view_action_render() { $this->view(); $this->render('/article/view'); } I would implement filters like in rails for a thing like Login screen, when I have some sparetime here at work I will do that... a before_filter is a method called return true or false wether or not a action and view should be processed :) /Dan On 5/2/06, Kevin <ke...@dr...> wrote: > > > This is just proof of concept... So no routing etc have been > > implemented... > > > > http://v.rummanddan.dk/article/view/12344 > > > > You can get the source at... > > > > http://v.rummanddan.dk/vc.tar > > > > I would happily contribute to this project, so let me know if its > > something you would go for... I didnt implement an ORM (ActiveRecord > > in rails) thats a whole lot of work itself, but I read you are > > discussing to do that yourself anyway :) > > Thanks, > > Just a few quick comments after peeking at the code: > > I like the REST style URI handling of the dispatcher. It makes it clean > and pretty easy to follow. > > I'm not clear on what you mean by routing. Is that like forwarding from > one controller to another? (ex: redirecting to a login screen, etc) If > you could provide an example on how that is used, it would help. > > We have a fair amount of code around accessing the database. I don't wan= t > to try and convert it to an ORM package. It'd be too much work with littl= e > benefit. > > -- > Kevin > > |