Skip to content

Commit

Permalink
some adds
Browse files Browse the repository at this point in the history
  • Loading branch information
vzuburlis committed Jun 29, 2020
1 parent 72486d3 commit 1559ecc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
21 changes: 10 additions & 11 deletions source/api-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Registers and fires events (hooks)

**Parameters**
- $event:string The event name.
- $handler:(function) The function to call.
- $handler:(function) The function to call. The functions should expect the parameters sent from *Event::fire()*, and return value when is called from *Event::get()*


### fire ()
Expand All @@ -30,13 +30,12 @@ Returns the result of the handler.


### Basic events
load
head
foot
sendmail
validateUserPassword
recaptcha
login.btn
login.callback
admin::media
admin::media-view
- **load** Runs after all packages where loaded. Useful to overrite values
- **head** Runs inside *<head>* tag in a public page
- **foot** Runs inside *<head>* tag in a public page
- **sendmail** Replaces *mail()* function in Sendmail class
- **validateUserPassword** Run from *User::create()* to accept the new password
- **recaptcha.form** Can print add a recaptha input in post form like register/contact-form
- **recaptcha** is called to verify the recaptcha code send from form
- **login.btn** can print new buttons in login form
- **login.callback** Runs from /login/callback endpoint
4 changes: 3 additions & 1 deletion source/api-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ Router::controller('my-ctrl', 'my_package/controllers/ctrl','myctrl');
**Parameters**
- $r:string The path
- $fn:function Callback for the route
- $method:string (optional)
- $method:string (optional) GET|POST
- $permissions:string (optional) User persmissions that restrict access

Examples:
```
Router::route('some.txt', function(){ echo 'Some text.'; });
# route with regex
Router::route('hello/(.*)', function($x){ echo 'Hello '.$x; });
Router::route('edit_page_/(.*)', function($x){ ... }, 'POST', 'editor');
```


Expand Down
4 changes: 2 additions & 2 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.13'
version = u'1.15'
# The full version, including alpha/beta/rc tags.
release = u'1.13.0'
release = u'1.15.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions source/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A simple **package.json** file:
"version":"1.0.0",
"description":"A short descriptive text of your package for what it does.",
"url":"package_url.com",
"author":"Your Name"
"author":"Your Name"
}
```

Expand Down Expand Up @@ -109,10 +109,10 @@ Gila::contentInit('mytable', function(&$table) {
// register a controller
// all /blog/* request are processed from class Blog in
// blog/controllers/blogController.php
Gila::controller('blog', 'blog/controllers/blogController', 'Blog');
Router::controller('blog', 'blog/controllers/blogController', 'Blog');
// add a new action for blog controller (/blog/topics)
Gila::action('blog','topics',function(){
Router::action('blog','topics',function(){
View::render('blog-topics.php', 'mypackage');
});
Expand Down

0 comments on commit 1559ecc

Please sign in to comment.