Skip to content
Snippets Groups Projects
Commit a7ba48de authored by dmitry.s's avatar dmitry.s
Browse files

fixed garbadge

parent 0f2015bb
Branches
Tags
No related merge requests found
$(function () {
$('.btn').on('click', function() {
alert(1);
});
});
\ No newline at end of file
......@@ -287,21 +287,3 @@ Route::set('javaSessionProvider', 'java_authentication')
'controller' => 'JavaAuthentication',
'action' => 'authentication'
]);
Route::set('test', 'test')
->defaults([
'directory' => 'Student',
'controller' => 'test',
'action' => 'go'
]);
Route::set('task1', 'task1')
->defaults([
'directory' => 'Student',
'controller' => 'task1',
'action' => 'go'
]);
Route::set('departments:main', 'departments(/<id>)', ['id' => '[0-9]+'])
->defaults([
'controller' => 'Departments', // classes/Controller/Departments.php
'id' => 1,
]);
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Handler_Task extends Controller_Handler
{
public function action_get()
{
$id = $this->post['id'];
$data = Model_Faculty::with($id);
$dep = $data->getDepartments();
$this->response->body(json_encode($dep));
}
}
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Student_Task1 extends Controller_Handler
{
public function action_go()
{
$data = Model_Faculty::with(1);
$dep = $data->getDepartments();
$twig = Twig::factory('task1');
$twig->set([
"Departments" => $dep
]);
$this->response->body($twig);
}
}
<head>
{{ HTML.script('static/js/libs/jquery-1.11.1.min.js') |raw }}
{{ HTML.script('static/js/config.js')|raw }}
{{ HTML.script('static/js/task1.js')|raw }}
</head>
<body>
<input type="text" size="1" name="num" min="1" max="10" value="1" class="textField">
<form>
<input type="button" name="button" value="OK" class='btn'>
</form>
<select id="departments">
{% for f in Departments %}
<option value="{{ f.ID }}">
{{ f.Name }}
</option>
{% endfor %}
</select>
</body>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment