Created
December 30, 2008 14:05
-
-
Save tedkulp/41627 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TestController extends SilkControllerBase | |
{ | |
function test_action($params) | |
{ | |
$this->set('test', 'Controller Works!'); | |
} | |
function test_ajax($params) | |
{ | |
$this->show_layout = false; | |
$resp = new SilkAjax(); | |
$resp->replace_html("#some_content", "New content says 'Hi!'"); | |
$resp->replace("#some_content", "style", "color: red;"); | |
$resp->insert("#some_content", " Append me, baby!"); | |
$resp->insert("#some_content", "Prepend me, too. ", "prepend"); | |
$resp->insert("#some_content", "<div id='after'>After</div>", "after"); | |
$resp->insert("#some_content", "Before ", "before"); | |
$resp->remove("#after"); | |
return $resp->get_result(); | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>{$title}</title> | |
{javascript file="lib/silk/jquery/jquery.js"} | |
{javascript file="lib/silk/jquery/jquery.color.js"} | |
{javascript file="lib/silk/jquery/jquery.silk.js"} | |
</head> | |
<body> | |
{$content} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Hello, world!</h1> | |
<p>The id is: {$params.id}</p> | |
<p>The controllers wants to say: {$test}</p> | |
{form remote='true' url='/silk/index.php/test/test_ajax'} | |
{textbox name="test" value="test" label="Test Me:"} | |
{select name="blah"} | |
{options items="0,blah,1,blah 2"} | |
{/select} | |
{submit} | |
{/form} | |
<div id="some_content"> | |
Some Content | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment