mvc

mvc jquery paging search results with only 1 query

I have a search page that I'm implementing as part of an ASP.NET + MVC + jquery site. The search query scores each result that is returned as part of the results set. i.e. Higher score for closer match. Because the results set can change, and because the algorithm that scores the matches is somewhat intensive, I only want to load the re...

What exactly is the model in MVC

I'm slightly confused about what exactly the Model is limited to. I understand that it works with data from a database and such. Can it be used for anything else though? Take for example an authentication system that sends out an activation email to a user when they register. Where would be the most suitable place to put the code for the...

Where to place Rails code that is not a model, view, controller or helper?

I want to share code not related to views between several controllers in my Rails app. Where in the directory structure should I place it? EDIT: the code in question if something all controllers use to determine how they render the model data ...

AS3: Model and View Communication in a Game

So I'm attempting to use the MVC pattern for a game I'm working on. Everything has been going pretty smoothly so far, but I'm having trouble figuring out how to get my model and my view to talk to each other effectively. My general model structure involves lots of nested information. a Level has Rooms a Room have Layers a L...

Where is the default namespace name kept in ASP.NET MVC?

I created a new ASP.NET MVC application with a Project Name of "HelloWorld", and did some basic testing. I then did a global rename of "HelloWorld" to "ApplicationName", but when I create a new controller, it still puts it into the "HelloWorld" namespace. How do I fix this? ...

Question regarding MVC: SubClass for DB activity

I just recently dove into OOP & now MVC and am using this template engine : http://www.milesj.me/resources/script/template-engine I am curious about one question on where to put my DB calls (I'm using a basic database wrapper class). I've seen two ways done. class Cart /** * Counts items in cart * @return int */ public static ...

ASP.NET MVC routing - trying to have a name in the url

hi all, I have currently the following routes: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{resource}.gif/{*pathInfo}"); MvcRoute.MappUrl("{controller}/{action}/{ID}") .WithDefaults(new { controller = "home", action = "index", ID = 0 }) .WithConstraints(new { controller...

MVC for a CMS? What about themes?

Hi I understand what is MVC and CMS. I understand MVC pattern and how CMS should working. But I have problem with theming and the pattern. Example: When CMS is installed on serwer I want to change my homepage. I want to display some additional data. I change my homepage template and add a function call to pull data from DB. My new dat...

About 3-tier architecture and symfony framework

Both of them are based from mvc. But in 3-tier architecture,storage layer is a separate layer, while in symfony framework,database(storage) level is included in model layer. Why are they different? ...

Permalinks with Russian/Cyrillic news articles

I basically am working with an oldschool php cms based site in Russian, one of the many new functionalities requested is permalinks. As of now, currently the website just uses the standard non-mvc 'article.php?id=50'. I was browsing the Russian wiki and this was really the only Russian site I've seen that made use of native Russian perm...

php class method is preventing xml from working correctly

Hello, I have a problem that I cannot understand I am trying to make my webservice work from a class. I try'd to echo the xml from some function in a controllerclass, but that diddn't work. So, I moved the xml around to a place where it did work. That means that I placed it before the loader function is called. That's where it still w...

Implementing Model-View-Controller the right way

Working on a game in Objective-C/Cocoa for OS X, and I finished the prototype as much as it's worth being finished. It's a mess of code, being my first game, but everything works. I've been reading up on the best way to put things together, and MVC seems to make the most sense, but I'm a bit confused. Where does it start? With the cont...

Can I use mvc without getters and setters?

If I don't want to expose the state of my object, but I still need to display it (in HTML, XML or JSON let's say), how would I go about doing that in an MVC environment. Does it make sense to have an export method which exports a dumbed down immutable object (a "data class" if you will). What about adding in a render method which talks...

Best practices when Design iPhone Game with MVC ?

Hi there, I have made two games for the iPhone already, the first one was a mess, and the second one is less messy but still, not perfect. I would love to hear if someone had some links that pointed to good class organization advice when creating games using MVC ? ...

iPhone 3.0 SDK: stacked presentModalViewController calls or in series?

Here's the scenario: if this is a user's first time logging into my web service, I present a modal login view. Upon success, the user may have multiple items in his/her account and must choose one of them before he/she can proceed with the rest of the app. I want to put up another modal view with a picker so the user can make the choic...

Framework design patterns

I am (as I'm sure many of you are) pretty familiar with Rails' MVC design pattern as well as Django (and others') MTV design patter. I was wondering what other patterns other frameworks use for web application development. What are their strengths/weaknesses? thanks ...

What to use instead of OnActionExecuting? ASP.NET MVC

I've got some things I do in the OnActionExecuting method in a BaseController, that all my other controllers are based off of. I'm doing some simple things like putting a variable into ViewData that "nearly" all of my views will need, and populating a couple properties that my controllers use. Thing that bugs me is, this work is being ...

Transitioning from an oldschool web framework to a more modern mvc based one?

At work we currently use a pretty outdated (php) "framework" that doesn't really make use of all the cool new stuff like spl autoloading, mvc, pretty much all the new stuff that came out for PHP in the last 2-3 years. I'm trying to transition this framework slowly into a more modern mvc based one but I don't want to jump the gun and com...

MVC best practice for *this* application in wpf?

Hi all What is the best practice for connecting a single data class which houses all information and communication to a UI coded in XAML? I am of course talking about the controller in MVC. This one class, call it Manager, exposes certain functionality such as Login() and GetNetData() etc. The UI is entirely in XAML, so it seems easy to...

Which MVC layer should set this value?

I'm working on a report that displays information about our company's sales locations. One of the bits of information is the 'last visit date' of the location. If the location has never been visited, I have to display (in the current language) 'Never' in red. There are several values like this one, this is just the example I'm using. Cu...