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: [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

Thought I has this figured out especially after all the help i received?
Cags, Salathe, Daniel helped me with this yesterday, but not sure i took it all in.
I am attempti

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

PHP error (line 38) my website
Hello everyone, I'm new on this
and I got a web site thats got a error not showing the photos on<

listing help
Hi,

at first, great new design!!! I like it,

i got a problem,

I want to list so

Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database i

Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Grouping and sorting results
Please help with this query.

I have 2 tables in a database, countires and cities. states look

Will this protect from mysql injection?
I do not want anything like DROP TABLE to work or any type of coding..

Heres my code.. is it

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

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