Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grocery_CRUD in view #81

Open
XpamAmAdEuS opened this issue Aug 11, 2016 · 1 comment
Open

Grocery_CRUD in view #81

XpamAmAdEuS opened this issue Aug 11, 2016 · 1 comment

Comments

@XpamAmAdEuS
Copy link

XpamAmAdEuS commented Aug 11, 2016

Hi.
I am having issues with position of CRUD in view.
Is there a way to set CRUD inside like this

> <div class="panel panel-default">
>         <div class="panel-heading"><h4 class="text-center">Server settings</h4></div>
>         <div class="panel-body">
> 
> Put crud here ?
> 
> 
>         </div>
>     </div>
@waifung0207
Copy link
Owner

To use Grocery CRUD within your custom view (instead of /application/modules/admin/views/crud.php), you can simply skip the Admin_Controller's render_crud() function and pass the CRUD object like:

$crud = $this->generate_crud('users');
$this->mViewData['crud'] = $crud;   // or use $this->mCrud
$this->render('my_view');

But then you will miss some functions from render_crud(), like you will need to add stylesheets / scripts to page manually - for reference please have a look on the render_crud() function from Admin_Controller.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants