controller

CI Borrow other controller's function in another controller

I have a controller for my front end, and I'm using the DX Auth lib. I want to use DX Auth's registration, but include it in my front page controller...I can simply copy-paste the function, but is there a better way to do this? ...

ASP.NET MVC Aggregate CSS/JS from multiple controllers

We have a fairly complex application that was previously using WebForms. We are in the process of rewriting bits of it from scratch using MVC. Our application is comprised of a number of widgets, that together make up the functionality of the application. In WebForms, we used UserControls. Each UserControl would register its CSS and Jav...

MVC with Qt widget that uses a QAbstractTableModel subclass

Hi, I'm doing some refactoring. I'm implementing a Model-View-Controller pattern. The view is a Qt widget. Originally, the Qt widget created a new instance of a QAbstractTableModel subclass on the heap. Lets call it FooTableModel. e.g Widget::Widget(QWidget* parent) : QWidget(parent) m_model(new FooTableModel(this)) { Should I ...

how to pass data from view to controller in asp.net mvc

What is the best way to pass random data from a view to a controller. I have a number of views that are identical except for a few pieces of state information. instead of creating a page for each webpage, I want to have one page and I just pass over these variables dynamically. ...

Is there any way to have language independent controllers/views/actions

I'm coding some web-applications in MVC, and I have a problem with something that has been on my mind for a time. The web-aplications I'm developing are mostly going to be used in Swedish, and because of the language I want to have my URL routing mapped against Swedish URL names. mysite.com/products/details/1 (English URL) mysite.com/...

Get controller and action descriptors for a url & parameters

Is it possible to use the MVC framework & reflection to get a controller and action descriptors for a url and a list of parameters? Basically I want to tap into 1) the logic to resolve a route and 2) the logic that determines which action signature matches the list of parameters coming from the client. Thanks. ...

ASP.NET MVC class that represents a controller+action set?

Is there a class in the ASP.NET MVC framework that represents a controller name and an action name? I'm writing a method that will return a collection of URLs and I want them to be returned as objects that contain a 'Controller' and 'Action' property or something similar. This is because sometimes I'll need to isolate just the controll...

Landscape animation bug when popping view controller in iPhone app

I've recently added landscape autorotation to my iPhone navigation based application, however I'm having a bizarre issue which I have no idea how to fix or whether my code is even the cuplrit. Its bizarre because I'm implementing everything as per the autorotation docs on Apple's developer center (that is responding to shouldAutorotateTo...

Accessing Controller Properties from a View

I have a User object on a Base controller, this is the standard type of User object you have with the .Net Membership Provider. I need this is decide if users have access to actions, views, and so on. I am having a problem whereby I want to display user information on the Masterpage. Like a login view from WebForms. I tried to access t...

ASP.NET MVC - Job of Controllers

Hello, I think I'm beginning to be confused with the job of a controller in MVC. I have a service that exposes five functions: list packages in queue get package delete package accept package deny package My ASP.NET MVC controller depends on this service, and can generally execute a service call on an Action. I'm happy so far. Th...

Controller and Previous view

Right now, I have an action associated with just the POST from the Index page in my MVC app. But I want a generic handler action that handles all page posts and within the POST Handler action, I want to know the view that I just came from. What I want is below: Any ideas? [AcceptVerbs(HttpVerbs.Post)] public ActionResult Gene...

IPhone SDK: Using Interface Builder to link arrays

Hi everyone, I´m trying to use Interface Builder (IB) to gain time in my app development. So I´m trying to do new things, for example, connecting objects between File´s Owners and Controllers. The situation is: 1 - I have a ViewController with a Nib. This view controller have an array set as a IBOutlet. 2 - I put a custom TableViewCo...

Map a route to the same controller action

I want only one controller action to handle all GETs. How can I map a route to do this? ...

Get ALL items in a SelectList within ASP.NET MVC controller

Is there a way to post all items in a SelectList (multiselect) to the method of a controller? By default when I use a SelectList it will only post the selected items to the Form. I have a couple of MultiSelect controls on a View. Using jQuery the user can move items from ListBox1 to ListBox2 and vice versa. When the form is posted I wan...

Zend Framework Invisible Controllers

Dear All, this is a rephrasing of a question I posted yesterday. I got an answer but an incomplete one. I studied a bit and can now reformulate the question in a clear, simple way. I create a project with Zend Framework. I get inside and I create a controller. When I try to access thr view of this new controller, it does not work. I g...

What's the best way to refactor this Rails controller?

I'd like some advice on how to best refactor this controller. The controller builds a page of zones and modules. Page has_many zones, zone has_many modules. So zones are just a cluster of modules wrapped in a container. The problem I'm having is that some modules may have some specific queries that I don't want executed on every pag...

ASP.NET MVC: Can't get string parameter in my controller

Hello, I have the following code in my controller called UserController: public ActionResult Details(string name) { MyModelDataContext db = new MyModelDataContext(); Product user = db.Products.Single(t => t.Name == name); return View(user); } I expect that when I browse directly to http://localhost:port/User/Details/SomeN...

Redirect_to with multiple controllers with shared tables - in rails

Hey guys, I'm pretty new to rails, so I apologize if this question has an obvious answer. I have multiple controllers with records stored based on relations for example, /books/1/titles/4 meaning the the title with ID 4, is only related to book with ID 1. in an action such as destroy, how can I use redirect_to to go to /books/1/titl...

Controller related to multiple controllers in rails

This is a tough one I think. I have a comments controller, that I'd like to use for all of my other controllers: such as books, titles, etc. The problem is, the create action in comments is: def create @book = Book.find(params[:book_id]) @comment = @book.comments.create!(params[:comment]) respond_to do |format| format.html...

How can I pass objects from one controller to another in rails?

I have been trying to get my head around render_to but I haven't had much success. Essentially I have controller methods: def first #I want to get the value of VAR1 here end def second VAR1 = ["Hello", "Goodbye"] render_to ?? end What I can't figure out is how to accomplish that. Originally I just wanted to render the first.ht...