Singapore CMS Web Design

Gary Consulting Group - Singapore CMS Web Design

Timely Support and Clarity in your journey to harness the power of the internet
Email:
sales@name1price.com
Call:
+1 415 300-0019
EzPublish Xajax (Hello World) PDF Print E-mail
User Rating: / 6
PoorBest 
Written by Zhiwen Teh   
Tuesday, 24 March 2009 23:49

This tutorial assumes you have already gone through the following pre-requisite tutorials

The objective of this tutorial is to help you create a special block that calls a Hello World function using Xajax.

It assumes that you have EzFlow installed on your site

Step one : Create a special block template file

  • Go to location extension > ezflow > design > ezflow > override > templates > block
  • create a file called xajax_hello.tpl

In the file insert content

<input type='button' onclick='xajax_hello_world()'>

<div id='msg'> </div>

Step two : Declare the new block in ezpublish

  • Go to location and open file extension > ezflow > settings > block.ini.append.php

Insert lines into file

<?php /*

AllowedTypes[]=HelloWorld

[HelloWorld]
Name=Hello World
ManualAddingOfItems=disabled
ViewList[]=hello_world
ViewName[hello_world]=Hello World

?>

Step three : Declare block template override

  • Go to location and open file settings > siteaccess > ezflow_site >override.ini.append.php

Insert lines into file

<?php /*
[hello_world]
Source=block/view/view.tpl
MatchFile=block/xajax_hello.tpl
Subdir=templates
Match[type]=HelloWorld
Match[view]=hello_world
?>

Step four : Extending Xajax

  • Go to location extension > ezflow > settings
  • Create file xajax.ini.append.php

Insert lines into file

<?php /*

[ExtensionSettings]
ExtensionDirectories[]=ezflow

AvailableFunctions[helloworld]=helloworld
*/ ?>

Step five : Creating the xajax script file

  • Go to location extension > ezflow >
  • Create folder xajax
  • Go to location extension > ezflow > xajax >
  • Create file helloworld.php

Insert lines into file

<?php

function helloworld(){

/*Ajax response*/
$resp = new xajaxResponse();
$resp->assign("msg","innerHTML", "Hello World");

return $resp;

}

?>

Step six : Clear your cache

Step 7 : Create a front page object and include a new block by the name of HelloWorld

Step 8 : Test out your new Xajax Hello World function

 
Tuesday, 27th Jun 2017
Content Management System powered by Gary from Name1Price.com