⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

changing default add and edit link url



nilesht
  • profile picture
  • Member

Posted 09 July 2012 - 06:49 AM

Since, as per my requirement I want to customize add form and edit form because my view needs jQuery tabs view. How can I change default add and edit link url to my customized url?

I have attached screenshot for more.

noskov.biz
  • profile picture
  • Member

Posted 09 July 2012 - 15:56 PM

Hi, nilesht!

Please, look at the Grocery CRUD add_action function. Hope that will help you.

nilesht
  • profile picture
  • Member

Posted 11 July 2012 - 10:04 AM

Its a nice to see your quick reply. But I am not looking for the solution you had given(use of add_action function). I want to change url comes for add operation, say for example: www.example.com/controllerName/methodName1/add replace to www.example.com/controllerName/addProduct/. because I want to use my own view, instead of default add view comes with grocery crud theme.

Thanks and regards,
Nilesh

fdias
  • profile picture
  • Member

Posted 11 July 2012 - 14:48 PM

That's a codeigniter issue and not GC.
The friendly URLs (using mod rewrite) are constructed with controller/method as you mentioned and the add is an argument of the method, so I believe you can change GC core and have another name there for example:

www.example.com/controllerName/methodName/yourAddFunctionName

Or you can use some routes to change it's name. Check docs from CI routes:

http://codeigniter.com/user_guide/general/routing.html

For what you want I believe you will need to route your URLs, but be carefull not to mess things up.

Hope this helps.

Cheers.