Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-15-2008, 10:31 AM
Junior Member
 
Join Date: Apr 2008
Location: The zombie room,Romania
Posts: 7
Send a message via Yahoo to americanu197
Default Making index the default controller

Ok the plan is this when someone enters a url like www.mypage.so/about
i want to get redirected to www.mypage.so/index/about so no matter what index is the only controller i dont understand why something like this works for language and module and not for index. Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 01:34 PM
lucasm's Avatar
Junior Member
 
Join Date: Mar 2008
Location: Įguas Claras-DF, Brazil
Posts: 13
Wink Advice for using modules, controllers and actions

americanu197,

I think you haven't understood yet the ZF's way.

We can use modules, controllers and actions. Each one has its own propose. I think using this concepts is the best way for most of problems. They help us to make the separation of application's code.

But there's some situations we must use another approach. In this case, I suggest you look for custom routes.

maybe those threads help you
regards,
__________________
Lucas Mauricio C. e Martins
CR Vasco da Gama, my biggest passion!

Ajude a Combater o Spam! - Help fighting spam!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 03:29 PM
Junior Member
 
Join Date: Apr 2008
Location: The zombie room,Romania
Posts: 7
Send a message via Yahoo to americanu197
Default I do understand

thanks for the help i understood the framework but i take orders and my boss is pretty old fashion he had me not use any subfolder like public or www and put everything in root and direct automatically to the index controller which is the only one in the site im building now anyway
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 12:57 PM
lucasm's Avatar
Junior Member
 
Join Date: Mar 2008
Location: Įguas Claras-DF, Brazil
Posts: 13
Cool Two ways...

americanu197,

In your case I see two ways:

1st: put your controllers in the root and say to zf that your controllers are there and use custom routes. For example, when the address begins with mod_, this will be a controller whatever else, it'll be an action. Your site would be like:
  • 10.1.1.10/ <- indexAction in indexController.php
  • 10.1.1.10/about <- aboutAction in indexController.php
  • 10.1.1.10/mod_clients <- indexAction in mod_clientsController.php (*)
  • 10.1.1.10/mod_favorites <- indexAction in mod_favoritesController.php (*)
  • 10.1.1.10/mod_favorites/edit <- editAction in mod_favoritesController.php (*)
(*) you can also set up your route to use the controller's name without mod_

2nd: put all your actions in one controller (index). Your site would be like:
  • 10.1.1.10/ <- indexAction in indexController.php
  • 10.1.1.10/about <- aboutAction in indexController.php
  • 10.1.1.10/clients <- clientAction in indexController.php
  • 10.1.1.10/favorites <- favoritesAction in indexController.php

regards,
__________________
Lucas Mauricio C. e Martins
CR Vasco da Gama, my biggest passion!

Ajude a Combater o Spam! - Help fighting spam!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:30 PM.