TemplatePower & AJAX


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,



Did you know?Explore Trending and Topic pages for more stories like this.
I'm currently implementing some AJAX features in my PHP-framework (which is based on TemplatePower) and I have encountered a problem:

I have a block which holds a message-div. This block is called upon (with the ->newBlock() method) by my message class. This way of showing message has worked great up until now (because every time a message should been shown, the page should be reloaded anyway).

But now I want to show a message when I click on a checkbox WITHOUT reloading the page. As I expected I received following error:
Code: [Select]Fatal error: Call to a member function newBlock() on a non-object in /home/www.myurl.com/message.php on line 28

And on line 28 i call $tpl->newBlock("MESSAGE"); where $tpl is an instance of TemplatePower.

As I didn't find a clear tutorial/solution for this via Google I'm presenting this problem to you guys: Is there an easy way to keep my current structure (with the template blocks) and let AJAX make use of this? Or should I rethink the structure?



TIA,
No comments posted yet

Your Answer:

Login to answer
344 Like 5 Dislike
Previous forums Next forums
Other forums

How to assign JS screen.width to ASP.Net variable
I've got this ASP.net routine that gets the cookie value of the screen width, but now I need to chan

Email to a friend script problems
I have this send-to-a-friend script with 2 issues:


1) When you open the form popup on a p

There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

help with contest script
I would like to code a contest script to my site but i don't know how. Could someone just give me pu

Why does my php page download images over and over
Can anybody please explain to me why my php page keeps downloading the images and other items every

DBCA Templates
Hi all,

I'm working on creating a template for DBCA, but can't find any documentation on the

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <

defining website tags
Hi,

What would be the best way to define tags for my site, such as website title, url etc.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash