• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asynchronous PHP in a view cell

#1
Just like the title says

Has anyone tried ?

Will it work ?

Because CI gathers all the information then renders it. I'm not sure on how the browser part works.
Reply

#2
You would need to make an ajax request in javascript.
Test your translation files with Translation Tester
Reply

#3
When you load the whole page a fragment the view should look something like this (pseudocode, the concept):

Code:
<div id="my_cell">
<?php echo view_cell(.....) ?>
</div>

<script>

// With some conditionality, when the cell should update (onclick on something, etc.)
$.ajax ....
....
"url" : '......the url to a wrapper controller',
"data" : {
    // Pass here the new parameter values
},
"cache": false,
....
success : function(html) {
    $('#my_cell').html(html);
},
....
....

</script>

And them you need to create a controller that serves this AJAX-call, this controller would take the updated parameters (through GET or POST, as you decide), it will call the view cell again with the new parameters and output the updated html-fragment.

Be sure to check/filter parameters while getting from GET/POST and to escape data on cell-output properly.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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