• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using PHP DataGrid(PHP Builder) in CodeIgniter

#1
[eluser]Unknown[/eluser]
Hi All,

I've been enjoying learning how to use CodeIngniter. I've been using PHP DataGrid (http://phpbuilder.blogspot.com/) to build things with and like the grid object. I'm now wanting to take these pages and put them into the CI framework. This isn't going as smoothly as I wanted. I'm pretty new to Apache/PHP (recovering .NET person) so I know that this HAS to be easy, but it is escaping me.

When I put one of my php DataGrid pages in the view directory, the page largely works, but it gets confused as to the path of where the html subdocuments and images can be found. The path that the final HTML is looking for is:

http://localhost/CodeIgniter/index.php/blog/datagrid/images/default/excel_b.gif

The anchor in the html is as follows:
<a style="cursor: pointer;" onclick="myRef=window.open(''+self.location+'?_abcexport=true','ExportToExcel','left=20,top=20,width=840,height=630,toolbar=0,resizable=0,location=0,scrollbars=1');myRef.focus()" class="class_a">
<img src="datagrid/images/default/excel_b.gif" onmouseover='this.src="datagrid/images/default/excel_r.gif"' onmouseout='this.src="datagrid/images/default/excel_b.gif"' alt="Export to Excel">
</a>

How can I adjust things so that 'this.src="datagrid/images/default/excel_r.gif" reads from http://localhost/CodeIgniter/datagrid/images/default/excel_b.gif instead?

#2
[eluser]abmcr[/eluser]
Thwe function site_url() return the url of your application: if you put your images into a /images folder you get it with a &lt;?=site_url()."images/image.jpg"?&gt;


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.