-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
53 lines (37 loc) · 1.09 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Author: Giovanni Manuel Toppi
Kohana v3.0 module
This module loads via ajax views inside your pages.
0 - Enable the module in your bootstrap.php
1 - Include jquery lib and jquery.ajaxcontent.js inside your page (the template view for example)
2 - Inside your page make an empty div, for example
<div id="widgets"></div>
3 - then in your application/views/widgets folder create some views.
4 - Set up your config file
return array(
'widgets' => array(
'default' => array(
'widgets/primo',
),
'other' => array(
'widgets/secondo',
),
)
);
(assuming that you've created primo.php and secondo.php)
where 'default' and 'other' are the categories...you can change it but maybe it's a good thing to leave the 'default' category.
5 - Then call with javascript
$(function(){
$("#widgets").ajaxcontent({
baseURL: 'http://localhost/',
category: 'default',
});
});
now you will see the view 'primo' inside '#widgets' div.
And if you call
$(function(){
$("#widgets").ajaxcontent({
baseURL: 'http://localhost/',
category: 'other',
});
});
you will see the view 'secondo'.