⚠ 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

Outputting GroceryCrud to a template



0dasfjk
  • profile picture
  • Member

Posted 29 May 2020 - 16:27 PM

Hello,

I have a growing interest in using grocerycrud, I am using grocerycrud enterprise with a codeigniter 3 framework,

Currently I want to be able to output grocerycrud into an admin template, I have failed to implement other user's contribution on previous posts,

I have a working .php gc in the controller along with a different .php dedicated for the admin template,

I have a working .php gc in the view along with a different .php dedicated for the admin template,

My difficulty lies upon merging gc contents into the admin template,

I hope you guys share how you were able to do that, and thank you!



 


0dasfjk
  • profile picture
  • Member

Posted 30 May 2020 - 12:58 PM

Using the following:

     <?php foreach($css_files as $file): ?>
          <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
     <?php endforeach; ?>                

    <div style="padding: 20px">
         <?php echo $output; ?>
    </div>
    <?php foreach($js_files as $file): ?>
        <script src="<?php echo $file; ?>"></script>
    <?php endforeach; ?>

inside my .php view file helped me display the grocery crud into my template, however I have noticed that nothing is clickable on the website, no interaction what so ever,

I have removed the following segment:
     <?php foreach($css_files as $file): ?>
          <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
     <?php endforeach; ?>   

From the code, and it became

 

 

    <div style="padding: 20px">
         <?php echo $output; ?>
    </div>
    <?php foreach($js_files as $file): ?>
        <script src="<?php echo $file; ?>"></script>
    <?php endforeach; ?>

In this state, I was able to interact with grocery crud table, however some elements of the tables weren't correctly aligned and there is a grocery crud error
 

 


0dasfjk
  • profile picture
  • Member

Posted 30 May 2020 - 14:58 PM

It turns out that I had to place this segment..

     <?php foreach($css_files as $file): ?>
          <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
     <?php endforeach; ?>  

before loading other text/css on my project,

IT WORKED!