devinemke wrote:just to be clear, it think you mean passing "objects" not "classes". yes you can pass objects from page to page using [man]serialize[/man] and [man]unserialize[/man]. be advised that when passing objects between pages using sessions that you must call the class definition before you call [man]session_start[/man].
I try to give a practical sample following devinemke advice and reply howto do this.
( thanks, this was an option I have never used before and an interesting possibility! )
Just for all us beginners.
Correct and add to my example, if should be needed, please.
Could be like:
<?php
include ( "./includes/my_template_class.php" ); // class with functions description / definition
session_start(); // to get access to stored session variables and objects
$object_1 = $_SESSION[ "my_object_stored_in previous_page" ];
$user_style = $_SESSION[ "user_previous_selected_template" ];
// Continue work with this existing object
// Call class function 'get_html_output()' to make HTML Output
// using custom style and output 'hello world'
$contents = $object_1->get_html_output( $user_style, "Hello world!" );
// Display HTML of page contents, in user prefered theme layout selected in earlier php page
echo $contents;
echo "<br />";
echo '<a href="index.php">Back home</a>';
exit;
?>
[right]/halojoy
... imagines he has written a ... Template Engine Class ...
... not yet ... maybe tomorrow ... maybe ...
🙂 🙂[/right]