⚠ 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

What's the best way to create a custom Add or Edit view?



jjwdesign

jjwdesign
  • profile picture
  • Member

Posted 08 December 2012 - 19:23 PM

I've been working with Grocery Crud for over a month now and I've found it extremely helpful. Most everything I've needed to modify has had a callback; with the great API documentation. Great work!

I've come across a situation where I need to create more customized Add and Edit views. I realize that one approach, would be to simply duplicate the entire theme folder with views, js, css, etc. But this seems a bit extreme. All I really want to override is the add.php view, located at /assets/grocery_crud/themes/datatables/views/add.php.

I noticed the add view is hardcoded in the grocery_crud.php library.

protected function showAddForm()

$this->_theme_view('add.php',$data);

What's the best approach to this problem?

Thank you,
Jeff Walters

jjwdesign

jjwdesign
  • profile picture
  • Member

Posted 11 December 2012 - 02:04 AM

Answer: Just copy the theme and drastically modify the views to your needs :)