controller

CodeIgniter only allow access to certain controllers when logged in

Hi I have some CodeIgniter controllers which should only be accessed by users who have logged in (i.e. where $this->session->userdata('username') is not null). If a non-authenticated person attempts to access said controllers they should receive: header('location: /auth/login'); There has got to be a better way to do this than to put...

asp.net mvc changing one menu based on which controller is selected from another menu

Hi, I am envisioning a site layout like this- top navigation menu linking to maybe 4 or 5 indexes of different controllers. each of these sections will be working with different model objects. Left navigation menu is specific to a controller. so, for each of the top menu buttons (corresponding to different controllers) I would like ...

Where to apply logic for a sidebar control in ASP.NET MVC

Take the example of wanting to have a "Latest news items" sidebar on every page of your ASP.NET MVC web site. I have a NewsItemController which is fine for pages dedicating their attention to NewsItems. What about having a news sidebar appear on the HomeController for the home page though? Or any other controller for that matter? My fir...

How do I mix nested resources with multiple post values when testing Rails controllers?

I have a model called "Post" which is a nested resource under a model called "Project" and I'm trying to test the controller. The code works find in my browser, but I can't get it to work in the test. Here's the test context "on POST to :edit" do setup do post( :edit, :project_id => @project1.to_param, :id => @post1...

Iphone UINavigationController onchange event

Hi there, i have an app that uses a navbar. What i want to acomplish is make it transparent when i push in the last view from the nav sequence, and make it opaque when i click the back button on the nav i tried with on dealoc, but it doesn't work. My view is an UIScrollView not an UiView, but i guess that makes no difference. As i see ...

Rails render if @transaction.save fails

I've been struggling with this for a while now... I have a more complex form (saves one transaction and two transaction_data at the same time). I got it to save all right, however I am struggling with the handling of errors. If I use the following in "create" - in case of an error - it doesn't hold any of the values I've had on the sam...

Eliminating the need for "controller" in the filename of a Zend Framework controller

How do I eliminate the need for the "Controller" suffix in the filename of a Zend Framework controller? It just gets tiresome to keep typing that suffix in when creating controllers, and meanwhile the file is already in a controllers folder so it's superfluous. For instance, by default the homepage on a site goes to "controllers/IndexCo...

how to pass Html.TextBox to controller?

May be this simple. But, I've hard time figuring it out. I've a controller with different actions that calls the DB code and return result. I want to pass the value of text box to different actions in controller. How to do it? I know that, I can pass values by using form. But, I don't to know how to call different actions in controller...

Manually instantiate a Controller instance from an arbitrary URL?

My skills are failing me, and I know I've seen the code around for this but I can't find it. What's the quickest way to take any arbitrary URL, run it through your asp.net mvc routing system, and come out with a reference to a controller instance on the other end? For example, code execution is inside some arbitrary controller method. ...

Where does input validation belong in an MVC application?

I have a MVC application that receives an input from a form. This is a login form so the only validation that is necessary is to check whether the input is non-empty. Right now before I pass it to the model I validate it in the controller. Is this a best practice or not? Does it belong to the model? ...

Passing nested data from Controller to View in ASP.Net MVC (LINQ)

I'm using LINQ to SQL (SQL Server) within ASP.Net MVC. My page needs to display all Regions and all Offices within each Region (nested). Offices belong to a Suburb, which in turn, belong to a Region. I.e. Within each Region, I need to grab the Offices which exist inside Suburbs which belong to the current Region in the loop. (Pseudo cod...

accessing Spring MVC DI beans from jsp

Im bit confused so be patient if im trying to do something wrong : -) In some MVC frameworks you can call controller action from the view if you whish to execute some code and render some partial view. Im not sure what is the correct way to do it in Spring MV I want to have set of JSP templates. Some of them will be page layouts some o...

Asp.Net MVC Utility Controller Action for filtered dropdown lists...

I was thinking of creating a UtilityController that only contains actions which return json because I might have several forms with a province/state dropdown and a country dropdown. These dropdowns are filtered by selection with ajax...only show prov/state in selected country. What do you think about this idea...is it good...bad...neith...

CakePHP: Need DB table for every controller?

Hello! I'm newbie to CakePHP but got strange error. I'm just testing it, how to implemetn many functions and got strange error. Created controller called 'about' and got following error: Error: Database table abouts for model About was not found. Does CakePHP require to have DB table for every single controller? PS... var $useTabl...

CakePHP, need suggestion

Good day! I need suggestions how to solve one case while developing app with CakePHP... I got layout created and named default.ctp. In that layout I got sidebar with some blocks and there're some statistics taken from the database. Now my solution: I just created model called Sidebar.php and there're some functions, then I set up data...

Call Controler not with full name

Hello All I am new with ASP.NET MVC.we create a controller like this 'AdminController' but call it only with the name of Admin. How ASP.NET MVC handle this that we don't need to call controller with full name? ...

Queries count for page in asp.net mvc

Hi! I want to calculate how much queries are executed when i request a page in asp.net mvc. Difficults in page logic: sum queries are executed in main controller action, but others - in widget controller actions, which are called by Html.ActionLink in master page. I wrote base class for all controllers in which i'm encapsulate query c...

Internet Access Controller using .net ( vb or c# )

I want to develop a software which restricts users internet access using vb6 or vb.net. This is not a baby sitter program but 1) whenever a client machine takes any browser it should ask for username and password. 2)There should be option for adding new users at the server side application. can anyone suggest any name of such a s...

Zend Framework and keeping all of my code together

I've added the following to my application.ini: [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" resources.frontController.controllerDirectory = APPLICATIO...

Zend Framework and LoginController with LoginForm

I've got some stuff I'm trying to do with ZF; I have a LoginController.php in application/controllers/ with class LoginController extends Zend_Controller_Action. Within it, I have the following: public function getForm() { return new LoginForm(array( 'action' => '/login/process', 'method' => 'post', ...