I found article in wiki, which answers to my question, but it doesn't
work even in fresh CakePHP installation (final).
Could please someone try or inspect this code?
CONTROLLER tests_controller.php
class TestsController extends AppController{
var $components = array('RequestHandler');
var $helpers = array('Html','Javascript','Ajax');
var $uses = null;
var $layout = 'tests';
function index()
{
}
function test_one()
{
}
}
LAYOUT tests.thtml
<html>
<head>
<title>TESTS</title>
<?php echo $html->charset('UTF-8')?>
<?php echo $javascript->link('prototype')?>
</head>
<body>
<?php echo $content_for_layout?>
</body>
</html>
VIEW tests/index.thtml
<?php echo $ajax->link('JS TEST', '/tests/test_one'); ?>
VIEW tests/test_one.thtml
<?php echo $javascript->codeBlock("alert('OK');"); ?>
My problem is: this JavaScript code is not executed in browser - I see
right response content in Firefox debug extension, I see
'evalScripts:true' in source code of tests/index page, but I'm probably
doing some stupid thing by wrong way. I'm trying it with CakePHP
0.10.9.2378_final and prototype 1.5.0_rc0 (from scriptaculous 1.6.1)
and I did only one change in app/config/core.php - set DEBUG to 0.
What I'm doing wrong? Any help is highly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---