Jump to content

Recommended Posts

hello, i have a class am working on, its a datagrid class.

In this datagrid i would like to able it to show form input fields like text boxes and check boxes during compile time by specifying a callback function to be called during compile time by smarty.

 

In my class, i register the function using eval(function_string) when the user of the class chooses to show such columns.

 

I got two questions -:

1) What is the best way to call a php function (which is in a class) during compile using smarty template (i am looking at ajax right now but not sure if there is an easier way).

2) Would the function exists if i use eval(function_string) to register it and then call it from another page without using eva(). For ex, i register a function like so

 

eval("function _selector(){return "<input type blah blah>; }");

and then i use this function in another page called test_call_back.php like so.

$value = $dataGrid->_selector();

instead of eval("$value=$datagrid->_selector()");

 

Will it prompt an error saying function does not exists or will it pass ?

 

Thank you for ure help in advance, Bye

Link to comment
https://forums.phpfreaks.com/topic/50775-smarty-calling-php/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.