Jump to content

framework


Destramic

Recommended Posts

hey guys ive been making and designing my own framwork which isnt far off completion now...im just wondering...do other frameworks have like a action/method which allows you to call another controller in a controller?

 

so bascially in your index page your able to call your news headline, voting poll, search etc...?

 

thanks guys

Link to comment
Share on other sites

Hello, you are talking about something that today I changed to my framework. I used to give the option to kill current Controller and start new one without redirecting, but that damaged the architecture clearness. So today I replaced that option with regenerating a post (changing what need to be changed) to the new Controller. In that way the user sees the URL that that Controller is responsible and it is really more clear to fallow what happens and where. As for search for example or log in there are some common actions that are handled by the Application Abstract Controller from where Controllers Inherits. Of course there are several other approaches … also I would like to read more opinions on that …

Link to comment
Share on other sites

I must add to my previous answer that regenerating a post to a new Controller is rather a tricky mater. I didn’t found any solution for doing this to what I understand as the proper way (redirecting to new page preserving POST) because sending headers to clients with post doesn’t make sense to it. Of course there are always curl and fsockopen if you want to post and get the contents within the programme but the user want actually redirect.

 

Clarifying that , I ended with my previous approach – holding any post data in season if there is submit through a controller , redirect to the new Controller, use the data of previous Post if there and delete them. That of course exclude posting with redirection to an external page from the application, but for that there is always the option of submitting through curl or fsockopen and get response. Of course that issue arise if you want to submit from inside the application , if you just want give the visitor to submit to other Controller there are numerous ways to do that (Html and Javascript).

Link to comment
Share on other sites

well the way i was thinking of doing is was loading the controller and action though the front controller...and i dunno how your framework operates but you could just include the controller like:

 

$news = new News_Controller();
$news->articles()
//retutning all the aticles

 

i dont know if this is a good way of doing things but it would work nicely in my framework

Link to comment
Share on other sites

on mine I have a small script that instantiates the controller, sets the parameters from POST then run the intended action and returns the results already digested by the view.

but of course, in the controller I can call another one and make it run something for me, only thing is that I can discard the result or play with the result object.

 

as in like, if you call 'erase' in a group controller, it calls the item controller and erases the itens of that group before commiting suicide.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.