TemplatePower & AJAX


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

Hi all,



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

Google voice
I currently have a form in html, but I want it in php so the information is not in the source code.<

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

Image upload - determine folder
I have an upload script that may be accessed from different directories. Problem is, the script is m

how to hide input fields on selection screen using variant attribute
Hello all,

I want to know how to hide input fields on selection screen using variant attr

Help with simple query
Hi,

I'm trying to do a Query with a Union where I want to print the number of rows $tc conta

Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel

BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,

I was able to successfully create an Inbound delivery with reference to a PO

Passing variables with pagination - iterating through unique id per link
Hi everyone,
I have seen a few topics like this one. Still cant find the specific thing, so I am

PHP Login
Hey!
I got this shopcart code online, am trying to modify it but am getting an error when i try a

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