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

I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bun

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

How to find OS bit version
How can I tell the person browsing my site is running 32, or 64 bit operating system?

Preventing blank or already entered values
Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLAN

temporary objects
Until now i thought every temporary object in C++ is created as constant. I'm wondering why my compi

SAP Management Console is blank
Dear All ,

I am facing problem in my des sever suddely in SAP Management Console is blank and

Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website

check how many commas the variable containing the query has between [i]select[/i
Hi...

iv made an sql table that contains id number - name of sql query and an sql query.
T

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

array ...
hi
Code: function formatCategories($categories, $parentId)
{
// $navCat stores all child

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