⚠ 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

how to edit view part



mayur.shastri143

mayur.shastri143
  • profile picture
  • Member

Posted 07 June 2012 - 06:56 AM

how to make changes in view file. should i shift code from theme folder to view page?

fdias

fdias
  • profile picture
  • Member

Posted 10 June 2012 - 15:36 PM

I'm not sure I understood your question.
But if you are using flexigrid theme you will see a folder views where you have add, edit, list and list_template views.

assets\grocery_crud hemes\flexigrid\views

Hope it helps.

mayur.shastri143

mayur.shastri143
  • profile picture
  • Member

Posted 12 June 2012 - 10:25 AM

yes but it will edit the view for every table where i used flexgrid.
but what about the MVC way?
there is no view for my ONE perticular controller.
how can i edit view for only one controller's view?
in GC we have one COMMON view for all

fdias

fdias
  • profile picture
  • Member

Posted 13 June 2012 - 17:05 PM

You can have as many views as you wish and load them on your controller.
Regarding different flexigrid view, if you need to change much from one version to another then you would need to edit and save that version as a differente theme, then you use that theme on the cruds you wish.

Cheers

kenvogt

kenvogt
  • profile picture
  • Member

Posted 14 June 2012 - 19:40 PM

You probably don't need to change the templates. What you need are view files that create a wrapper around the coded rendered by Grocery CRUD with ->render(). You would do something like this in your controller:


$data = $crud->render();
$this->load->view('my_view', $data);

Then you would have a view file (named 'my_view.php') like this:



<body>
<h1>My Header</h2>
<!-- What follows is the output from render()
<?php echo $output; ?>
<table>
<tr>
<td>any html I want</td>
</tr>
</table>
<p>a footer paragraph>
</body>