| Methods |
public
|
page_init()
Advance
Overload, Event Handler For Gate Type development
Advance
Overload, Event Handler For Gate Type development
|
#
|
public
|
page_load()
Advance
Overload, Event Handler For Gate Type development
Advance
Overload, Event Handler For Gate Type development
|
#
|
public
|
page_event(string $event, string $evtp)
Advance
Gate Event handler like (url=index-page-contacts.html)
this function gives $event = page and $evtp = contacts
Advance
Gate Event handler like (url=index-page-contacts.html)
this function gives $event = page and $evtp = contacts
|
#
|
public
|
page_action(string $act, string $event, string $evtp)
Advance
Custom action designer. Default value delete or view or evt.
like for events value = evt
Advance
Custom action designer. Default value delete or view or evt.
like for events value = evt
|
#
|
public
|
page_delete()
Special Event
Delete Event Handler, occur when browser get (url=index-delete.html)
where index is Gate of Gate and Gate…
Special Event
Delete Event Handler, occur when browser get (url=index-delete.html)
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_view()
Special Event
View Event Handler, occur when browser get (url=index-view-19.html)
where index is Gate of Gate and Gate…
Special Event
View Event Handler, occur when browser get (url=index-view-19.html)
where index is Gate of Gate and Gate path is in reg.php file
view = event name
19 = recid of database table or any other value.
|
#
|
public
|
page_submit()
Special Event
Submit Event Handler, occur when browser post form (url=index.html)
where index is Gate of Gate and Gate…
Special Event
Submit Event Handler, occur when browser post form (url=index.html)
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_insert()
Special Event
Insert Event Handler, occur when browser post form (url=index.html) as new form
where index is Gate of…
Special Event
Insert Event Handler, occur when browser post form (url=index.html) as new form
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_update()
Special Event
Update Event Handler, occur when browser post form (url=index.html) as filled form
from database with…
Special Event
Update Event Handler, occur when browser post form (url=index.html) as filled form
from database with view_data function
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_new()
Special Event
New Event Handler, occur when browser get (url=index.html) first time
where index is Gate of Gate and…
Special Event
New Event Handler, occur when browser get (url=index.html) first time
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_unload()
Advance
Overload, Event Handler For Gate Type development
Advance
Overload, Event Handler For Gate Type development
|
#
|
public
|
getEvent(): string
Get Gate Event name of current request
Get Gate Event name of current request
|
#
|
public
|
getEventParameter(): string
Get Gate Event parameter of current request
Get Gate Event parameter of current request
|
#
|
public
|
readyPage()
Advance
Overload, Event Handler For Gate Type development
Advance
Overload, Event Handler For Gate Type development
|
#
|
public
|
init()
Advance
Overload, Event Handler For Gate Type development
Advance
Overload, Event Handler For Gate Type development
|
#
|
public
|
getAuthenticatePerm(string $perm = null, string $gate = null): boolean
Set which user Permission can access this Gate. Default Permission is ALL.
You can set session variable in login Gate …
Set which user Permission can access this Gate. Default Permission is ALL.
You can set session variable in login Gate
SphpBase::sphp_request()->session('lstpermis','profile-view,prfile-delete');
If user is not login with specific permission then Gate exit and
redirect according to the getWelcome function in comp.php
Parameters
| $perm |
Default=null mean, permission to everyone
|
| $gate |
optional Default is current Gate, permission like index-view where index is Gate.
permission to allow Gate Processing. Example:- AuthenticatePerm("view")
|
Returns
true if permission match with session variable lstpermis, never return false
|
#
|
public
|
hasPermission(string $perm, string $gate = null): bool
Check Permission is given to authorised user or not given.
Check Permission is given to authorised user or not given.
Parameters
| $perm |
permission to check
|
| $gate |
optional Default is current Gate, permission like index-view where index is Gate.
|
Returns
return true if permission found
|
#
|
public
|
Authenticate(string $auth = ""): boolean
Set which user can access this Gate. Default user is GUEST.
You can set session variable in login Gate
SphpBase::sphp…
Set which user can access this Gate. Default user is GUEST.
You can set session variable in login Gate
SphpBase::sphp_request()->session('logType','ADMIN');
If user is not login with specific type then Gate exit and
redirect according to the getWelcome function in comp.php
Parameters
| $auth |
comma separated list of string. Example:- Authenticate("GUEST,ADMIN") or Authenticate("ADNIN")
|
Returns
true if user type match with session variable logType, never return false
|
#
|
public
|
AuthenticateSVAR(string $auth = "")
Advance
Authorise base on server variables, in session less environment
Advance
Authorise base on server variables, in session less environment
|
#
|
public
|
checkUnAuth(string $param): boolean
Check if user type in session logType = unauthorised
Check if user type in session logType = unauthorised
Parameters
| $param |
comma separated list of string. Example:- checkUnAuth("GUEST,ADMIN") or checkUnAuth("ADNIN")
|
Returns
true if user type match with session variable logType
|
#
|
public
|
checkAuth(string $param): boolean
Check if user type in session logType = authorised
Check if user type in session logType = authorised
Parameters
| $param |
comma separated list of string. Example:- checkAuth("GUEST,ADMIN") or checkAuth("ADNIN")
|
Returns
true if user type match with session variable logType
|
#
|
public
|
getAuthenticateType(): string
Read logType session variable as User Type of login user which is set in login Gate
Read logType session variable as User Type of login user which is set in login Gate
|
#
|
public
|
sesSecure(): Gate
Gate exit if URL isn't session secure
Gate exit if URL isn't session secure
Returns
exit if URL isn't session secure
|
#
|
public
|
forward(string $loc)
Forward request to url
|
#
|
public
|
isInsertMode(): bool
Return True if page_insert event triggered
Return True if page_insert event triggered
|
#
|
public
|
isUpdateMode(): bool
Return True if page_update event triggered
Return True if page_update event triggered
|
#
|
public
|
isViewMode(): bool
Return True if page_view event triggered
Return True if page_view event triggered
|
#
|
public
|
isDeleteMode(): bool
Return True if page_delete event triggered
Return True if page_delete event triggered
|
#
|
public
|
isSubmitMode(): bool
Return True if page_submit event triggered
Return True if page_submit event triggered
|
#
|
public
|
isNewMode(): bool
Return True if page_new event triggered
Return True if page_new event triggered
|
#
|
public
|
isUserEventMode(): bool
User Event is a type of PageEvent as a custom Event build from url which
doesn't match with any inbuilt Event.
Return…
User Event is a type of PageEvent as a custom Event build from url which
doesn't match with any inbuilt Event.
Return True if page_event_* User event triggered
|
#
|
public
|
setDBEngine(MySQL $objdbengine)
Set default Database Engine for execute query and managing connections
Default is MySQL
Set default Database Engine for execute query and managing connections
Default is MySQL
|
#
|
public
|
deleteRec(string $recid = "")
This Function delete the record of database table with generate and execute delete query.
DELETE FROM $tblName WHERE id…
This Function delete the record of database table with generate and execute delete query.
DELETE FROM $tblName WHERE id='$evtp'
$tblName = default table of Gate
$evtp = \SphpBase::page()->getEventParameter()
Parameters
| $recid |
If empty then use event parameter as record id.
|
|
#
|
public
|
insertData($form1, array $extra = [])
When Components use Database Binding. Then This Function insert the values to database table from a
component value.…
When Components use Database Binding. Then This Function insert the values to database table from a
component value. This insert a new record in table.
$extra = array()
$extra['table']['datecreate'] = date('Y-m-d)
OR
$extra[]['datecreate'] = date('Y-m-d)
insertData($extra)
Parameters
| $extra |
extra fields to insert with query.
|
|
#
|
public
|
viewData(type $form, string $recID = "", string $fldList = "", string $where = "")
When Components use Database Binding. Then This Function Fill the values from database table to a
Component value.<br>…
When Components use Database Binding. Then This Function Fill the values from database table to a
Component value.
changeable $sql = "SELECT $fldList FROM $tbln $where"
$tbln = use default tblName of Gate or Components dtable attribute
SphpBase::page()->viewData(,,"WHERE id='1'");
SphpBase::page()->viewData('','aname,pass,lst',"WHERE lastname='devel'");
Parameters
| $form |
Form Component
Read value from database and fill all Children Components of Form object which is bind with field of table.
|
| $recID |
Every table should have unique,auto increment and primary filed and default it has name id.
id = record id in table, pass this record id to $recID or if it is empty then it uses SphpBase::page()->getEventParameter()
|
| $fldList |
pass comma separated list of table fields or otherwise it is *
|
| $where |
WHERE Logic in SQL
|
|
#
|
public
|
updateData(Component $form1, array $extra = [], string $recID = '', string $where = '')
When Components use Database Binding. Then This Function Update the values to database table from a
Component value.…
When Components use Database Binding. Then This Function Update the values to database table from a
Component value. This update old record in table. This will only update Children of Form Component only.
It will not update all bound components to Database. So Form Component is required to pass.
$extra = array()
$extra['table']['dateupdate'] = date('Y-m-d)
OR
$extra[]['dateupdate'] = date('Y-m-d)
updateData($extra)
Parameters
| $form1 |
Form Component or container uses for getAllChildren.
|
| $extra |
is extra fields to insert with query.
|
| $recID |
Optional if empty then use $form1->getRecID()
Every table should have unique,auto increment and primary filed and SartajPHP use default name "id".
id = record id in table, pass this record id to $recID or if it is empty then it uses
Form Component recID = $form1->getRecID()
|
| $where |
WHERE Logic in SQL You can over write WHERE id=1 login to use other
field to update record.
|
|
#
|