Skip to content

Commit 5df2940

Browse files
committedAug 31, 2020
class Config
1 parent 8f0002f commit 5df2940

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed
 

Diff for: ‎source/api-gila.md renamed to ‎source/api-config.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Class Gila
1+
## Class Config
22
Common methods for Gila CMS
33

44

@@ -10,7 +10,7 @@ Common methods for Gila CMS
1010

1111
Example:
1212
```
13-
Gila::addLang('mypackages/lang/');
13+
Config::addLang('mypackages/lang/');
1414
```
1515

1616

@@ -36,7 +36,7 @@ Gila::addLang('mypackages/lang/');
3636
Example:
3737

3838
```
39-
Gila::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
39+
Config::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
4040
```
4141

4242

@@ -49,7 +49,7 @@ Gila::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
4949

5050
Example:
5151
```
52-
Gila::content( 'mytable', 'package_name/content/mytable.php' );
52+
Config::content( 'mytable', 'package_name/content/mytable.php' );
5353
```
5454

5555

@@ -62,7 +62,7 @@ Gila::content( 'mytable', 'package_name/content/mytable.php' );
6262

6363
Example:
6464
```
65-
Gila::contentInit( 'mytable', function(&$table){
65+
Config::contentInit( 'mytable', function(&$table){
6666
// unlist a column from content administration
6767
&$table['fields']['column1']['list] = false;
6868
});
@@ -81,7 +81,7 @@ Gila::contentInit( 'mytable', function(&$table){
8181

8282
Example:
8383
```
84-
Gila::amenu([
84+
Config::amenu([
8585
'item'=>['Item','controller/action','icon'=>'item-icon']
8686
]);
8787
```
@@ -96,7 +96,7 @@ Gila::amenu([
9696

9797
Example:
9898
```
99-
Gila::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']);
99+
Config::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']);
100100
```
101101

102102

@@ -158,8 +158,8 @@ Gila::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']
158158

159159
Examples:
160160
```
161-
$url1 = Gila::make_url('blog','post',[1]);`` returns mysite.com/blog/post/1
162-
$url1 = Gila::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
161+
$url1 = Config::make_url('blog','post',[1]);`` returns mysite.com/blog/post/1
162+
$url1 = Config::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
163163
```
164164

165165

@@ -172,7 +172,7 @@ $url1 = Gila::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
172172

173173
Example:
174174
```
175-
Gila::mt('my-table')
175+
Config::mt('my-table')
176176
```
177177

178178

@@ -186,6 +186,6 @@ Gila::mt('my-table')
186186
Example:
187187

188188
```
189-
Gila::updateMt('my-table')
189+
Config::updateMt('my-table')
190190
191191
```

Diff for: ‎source/api-moreclasses.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Loads or updates a string.
168168
```
169169
Cache::remember('post-'.$id, 3600, function($list) use($id){
170170
return 'Post#'.$id.'. Updated at '.data($list[0]);
171-
}, [Gila::mt('post')]);
171+
}, [Config::mt('post')]);
172172
```
173173

174174
### page ()
@@ -182,6 +182,6 @@ Saves or loads the rest of the output from cache. The remember() method should b
182182
**Example**
183183
```
184184
if(Session::userId()===0) {
185-
Cache::page('page.post-'.$id, 3600, [Gila::mt('post')]);
185+
Cache::page('page.post-'.$id, 3600, [Config::mt('post')]);
186186
}
187187
```

Diff for: ‎source/api-table.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Updates or creates table in database based on schema. Can be used from update.ph
123123

124124
Example
125125
```
126-
Gila::content('post','core/tables/post.php');
126+
Config::content('post','core/tables/post.php');
127127
$postTable = new Table('post');
128128
$postTable->update();
129129
```

Diff for: ‎source/package_examples.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ widgets/twitter-timeline/twitter-timeline.php
6161
<?php
6262
6363
// registers the widget name and its path
64-
Gila::widgets([
64+
Config::widgets([
6565
'twitter-timeline'=>'twitter-timelines/widgets/twitter-timeline'
6666
]);
6767
```
@@ -78,12 +78,12 @@ $options=[
7878
**widgets/twitter-timeline/twitter-timeline.php** is the view file of the widget, it will generate the html code. We use the embedding Twitter content from [here](https://publish.twitter.com)
7979
```
8080
<?php
81-
$account = Gila::option('twitter-timelines.accountID','gilacms');
81+
$account = Config::option('twitter-timelines.accountID','gilacms');
8282
?>
8383
<a class="twitter-timeline" data-height="400" href="https://twitter.com/<?=$account?>">Tweets by <?=$account?></a>
8484
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
8585
```
86-
**Gila::option()** gets the option of the package that we set up in the package settings. A default value can be used if the option is null.
86+
**Config::option()** gets the option of the package that we set up in the package settings. A default value can be used if the option is null.
8787

8888
Activate the package. Now in */admin/widgets* you can create a new widget with type *twitter-timeline* and set the widget area *sidebar* or *dashboard* to see it.
8989

@@ -111,7 +111,7 @@ load.php
111111
112112
// make changes to the user content type
113113
114-
Gila::contentInit('user', function(&$table){
114+
Config::contentInit('user', function(&$table){
115115
$table['fields']['useraddress'] = [
116116
'title'=>"Address", //the label
117117
'type'=>'meta', //the values of the field will be stored in a meta table

Diff for: ‎source/packages.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ You can get the option values like that:
6060
// options are saved using as prefix the package's folder name
6161
// for example if the package has the folder my_package/
6262
63-
$option1 = Gila::option("my_package.option1");
64-
$lang = Gila::option("my_package.lang","en"); // use default value 'en'
63+
$option1 = Config::option("my_package.option1");
64+
$lang = Config::option("my_package.lang","en"); // use default value 'en'
6565
```
6666
More information for [**package.json schema**](schemas.html##package-json).
6767

@@ -84,23 +84,23 @@ Some things you can do in a load file:
8484
<?php
8585
8686
// add menu item or menu sub item
87-
Gila::amenu(['mymenuitem'=>['Item',"myctr",'icon'=>'link']]);
88-
Gila::amenu_child('mymenuitem',['Sub Item',"myctr/sub",'icon'=>'link']);
87+
Config::amenu(['mymenuitem'=>['Item',"myctr",'icon'=>'link']]);
88+
Config::amenu_child('mymenuitem',['Sub Item',"myctr/sub",'icon'=>'link']);
8989
9090
// add an event listener
9191
Event::listen('load', function() {
9292
// this function will run after all load.php from active packages
93-
if(Gila::hasPrivilege('admin')==false) {
93+
if(Config::hasPrivilege('admin')==false) {
9494
View::renderFile('landing-page.php', 'mypackage');
9595
exit;
9696
}
9797
}
9898
9999
// register new content type
100-
Gila::content('mytable', 'mypackage/tables/mytable.php');
100+
Config::content('mytable', 'mypackage/tables/mytable.php');
101101
102102
// add new column on an existing content type
103-
Gila::contentInit('mytable', function(&$table) {
103+
Config::contentInit('mytable', function(&$table) {
104104
$table['fields']['newfield'] = [
105105
'title'=>"New Field", // the label to display
106106
'qtype'=>'varchar(80)', // the column type at database schema

Diff for: ‎source/themes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Make a copy of *gila-blog* and name it *my-clone-theme*. In *package.json* file
8282
Some use case of load.php
8383
```
8484
// add new widget areas that theme includes
85-
array_push(Gila::$widget_area, 'footer','sidebar','post.after');
85+
array_push(Config::$widget_area, 'footer','sidebar','post.after');
8686
8787
// include stylesheet
8888
View::stylesheet('lib/font-awesome/css/font-awesome.min.css');

Diff for: ‎source/toctree.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Contents:
3333
:caption: Api:
3434

3535
api-router
36-
api-gila
36+
api-config
3737
api-view
3838
api-session
3939
api-event

0 commit comments

Comments
 (0)
Please sign in to comment.