Hi, I was able to integrate PhpExt inside a joomla site (1.5) with
little change.
What I did was to put the PhpExt directory (php-ext\library\PhpExt) in
the joomlasite/libraries directory (it will stay as /joomlasite/
libraries/PhpExt).
Then I put the ExtJs directory (php-ext\resources\ext-2.0.2) on the
joomlasite/includes/js directory (I renamed it to only extjs, so it
will stay as /joomlasite/includes/js/ext).
Then I created a test component for testing. I created a directory
com_tests in the joomlasite/components directory. Then created a
tests.php file in that directory. I used the json grid example, so I
copied also the json_exampledata.php file to the root of the joomla
site.
The first thing to do in the tests.php file is to add the ext-all.css,
ext-base.js, and the ext-all.js files to the document
$uri =& JUri::getInstance();
$document =& JFactory::getDocument();
$document->addStyleSheet($uri->base() . 'includes/js/extjs/resources/
css/ext-all.css');
$document->addScript($uri->base() . 'includes/js/extjs/adapter/ext/ext-
base.js');
$document->addScript($uri->base() . 'includes/js/extjs/ext-all.js');
Then you set the include_path to append the joomlasite\libraries dir
$path = realpath('.');
$path .= DS . 'libraries';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
Then you add all the include_once directives, but since we're on
joomla, we'll use the joomla syntax
jimport('PhpExt.Javascript');
jimport('PhpExt.Ext');
jimport('PhpExt.Data.SimpleStore');
jimport('PhpExt.Data.ArrayReader');
jimport('PhpExt.Data.JsonReader');
jimport('PhpExt.Data.ScriptTagProxy');
jimport('PhpExt.Data.FieldConfigObject');
jimport('PhpExt.Data.StoreLoadOptions');
jimport('PhpExt.Data.HttpProxy');
jimport('PhpExt.Data.JsonStore');
jimport('PhpExt.Toolbar.PagingToolbar');
jimport('PhpExt.Grid.ColumnModel');
jimport('PhpExt.Grid.ColumnConfigObject');
jimport('PhpExt.Grid.GridPanel');
Then you copy-paste the rest of the source for the json grid example,
with a few adjustments, #1:
// Store
$store = new PhpExt_Data_Store();
$store->setUrl($uri->base() . 'json_exampledata.php')
->setReader($reader)
->setBaseParams(array("limit"=>$PageSize));
and #2:
echo '<script type="text/javascript">';
// Ext.OnReady -----------------------
echo PhpExt_Ext::onReady(
$changeRenderer,
$pctChangeRenderer,
$store->getJavascript(false, "store"),
$store->load(new PhpExt_Data_StoreLoadOptions(array(
"start"=>0,"limit"=>$PageSize))
),
$grid->getJavascript(false, "grid"),
$grid->render("grid-example")
);
echo '</script>';
?><div id="grid-example"></div>
Finally, point your web browser to the address
http://localhost/joomlasite/index.php?option=com_tests
Voilá!!