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: 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?
No comments posted yet

Your Answer:

Login to answer
231 Like 34 Dislike
Previous forums Next forums
Other forums

Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for eve

IDOC error
Hi, When i send IDOC from ECC system to MII there is no problem ECC side, i says message sent succe

the problem with str_replace
$str="hahahahahahahahahahahahahaha";
$nn=1;
$str=str_replace('ha','MyGod',$str,$nn);

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

Issue Parsing XML into table
Hello all,

Im a bit new to php and new to phpfreaks. But thanks in advance for the help!
<

isset undefined variable
Hi all,

Hope someone can point out the obvious. I've a log in script, if you dont enter a use

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

help with mysql_error()
Hi,

I am trying to insert data into a table, but I am not able to insert it. I wanted to see

Simple MySQL script is not working
Hey guys,

Just familiarizing myself with PHP and MySQL. I am following along in the O'Reilly

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