Skip to main content
Topic: PHPRad newbie with a lot of questions: Internationalization, API RESTFUL, etc. (Read 3286 times) previous topic - next topic

PHPRad newbie with a lot of questions: Internationalization, API RESTFUL, etc.

Hello.

I'm new to PHPRad and have a lot of questions:

1. Internacionalization
PHPRad supports internationalization?

2. API REST
With PHPRad it's possible to make REST APIs to run alongside the app?
Example: Using PHPRad to make a Admin panel to a mobile app. So the mobile app need an API to connect to admin panel via API RESTFUL.

3. Custom input fields, with mask, like Brazil CPF/CNPJ documents, Phone number, ZIP-Code
PHPRad has any way to add masks to form fields? For example mask for CPF, ZIP-Code, Phone Number, etc

4. Custom form data validation
It's possible to make custom validation in forms fields data? For example here on Brazil we need to validate some country documents, like CPF, CNPJ, PIS, etc.

5. Background actions
It's possible to run some tasks in background?
  • Example 1: Events and observers like in laravel framework. When framework watch any data changes like add new item, update, delete... and when occurs, dispatch some predefined tasks with events or observer pattern.
  • Example 2: Integrate with redis for queues for backup tasks, like send emails, push notifications, etc
  • Example 3: Some scheduled jobs to run like a cronjob.

6. Cache data
PHPRad supports anycache system, like Memcached or redis?

7. Multi tenant apps with different databases per domain
PHPRad can work with multiple database connection and multi tenant architecture ?
Example: I intent to make an app, when with some domains in same server. Each domain with it's own database.

8. Auth Providers, facebook, twitter, etc
Hi, can i use external authentication providers, like facebook, twitter, auth0, firebase auth, etc?
Wemerson Guimaraes
Brazil

Re: PHPRad newbie with a lot of questions: Internationalization, API RESTFUL, etc.

Reply #1
@wemersonrv

1. Internacionalization
yes, it supports it.

2. API REST
Yes, it is possible.

3. Custom input fields, with mask, like Brazil CPF/CNPJ documents, Phone number, ZIP-Code
Yes, it supports, but require extra knowledge of regexp(regular expression).

4. Custom form data validation
yes, it is possible, as phprad provides the option for you to add your custom code like PHP, JS, CSS, and HTML. with JS you can do the validation at the client-side and with PHP you can do it at the server-side.

5. Background actions
Yes, it is possible, you can add PHP code to execute before or after the action(view, add, edit and delete) is done.

6. Cache data
PHPRad uses a cache, but I am not sure if it supports the ones you listed above.

7. Multi tenant apps with different databases per domain
I don't understand this question, you will have to elaborate more.


8. Auth Providers, facebook, twitter, etc
yes, you will have to do that manually after generating your app with phprad.

 

Re: PHPRad newbie with a lot of questions: Internationalization, API RESTFUL, etc.

Reply #2
Tx for your answers... how to do these stufs are in official documentation?

Below I added in red, replicas to your answers.

1. Internacionalization
yes, it supports it.
It's a configurable option on PHPRad or need to make id manually?

2. API REST
Yes, it is possible.
Did you have any example on how to do that?

3. Custom input fields, with mask, like Brazil CPF/CNPJ documents, Phone number, ZIP-Code
Yes, it supports, but require extra knowledge of regexp(regular expression).
Only with regex? I'm asking because have some input masks running in my php(Laravel) and nodejs(AdonisJS) apps and it would be great if i can port them to PHPRad... Some use regex, some do not!

4. Custom form data validation
5. Background actions
Yes, it is possible, you can add PHP code to execute before or after the action(view, add, edit and delete) is done.
Validation in server-side uses the same idea of you answer for 4th question right? I just need to put the validation codes to works before add/update/delete, because PHPRad provides option for add PHP custom code

6. Cache data
PHPRad uses a cache, but I am not sure if it supports the ones you listed above.
What type of cache stuffs are used by PHPRad?

7. Multi tenant apps with different databases per domain
I don't understand this question, you will have to elaborate more.
Imagine an e-commece app, that sells spaces to stores works online without havin their own website, so the app has space to multiple stores on same server. Each store cames with it's own domain (or use a subdomain on my own domain)

My Domain: myphpradstore.com

Store 1: Fictional Store
Subdomain: firststore.myphpradstore.com
Has it's own domain: NOT
   Domain: -----

Store 2: Second Fictional Store
Subdomain: secondtstore.myphpradstore.com
Has it's own domain: YES
   Domain: secondstore.net

So for each store account created, will create it's own database with all store schema ready to works. And when an user access a specific domain/subdomain for each store, app must use this domain/subdomain to detect the right database and use only it from this point.

First: Check default database for account via domain, and after reach it, get the righ database credentials.
Second: From that point on, uses the right database for the store



Wemerson Guimaraes
Brazil

Re: PHPRad newbie with a lot of questions: Internationalization, API RESTFUL, etc.

Reply #3
@wemersonrv

1. Internacionalization
it is partially a configurable option. the only configuration for it is turning it on and selecting the default language. Then you can now provide your language .ini file and place it in the language folder, according to phprad specs.

2. API REST

Code: [Select]
 /**
 * call model action to retrieve data
    * @return json data
    */
 
 function json($action, $arg1 = null, $arg2 = null){
       $model = new SharedController;
       $args = array($arg1 , $arg2);
       $data = call_user_func_array(array($model,$action),$args);
       render_json($data);
 }

which translate to {root url}/api/json/ e.g http://localhost/api/json/ or http://example.org/api/json
you can read API Docmentation here.


3. Custom input fields, with mask, like Brazil CPF/CNPJ documents, Phone number, ZIP-Code
If you have a custom input code you can use it with phprad as it allows you to add custom codes for fields and pages.

4. Custom form data validation
5. Background actions
Validation in server-side uses the same idea of you answer for 4th question right? I just need to put the validation codes to works before add/update/delete, because PHPRad provides option for add PHP custom code
Yes, it does.

6. Cache data
it is used to store temp data by the system, not yet available for users to implement.

7. Multi tenant apps with different databases per domain
Imagine an e-commece app, that sells spaces to stores works online without havin their own website, so the app has space to multiple stores on same server. Each store cames with it's own domain (or use a subdomain on my own domain)
No, it's currently not supported. you will have to manually write the code that will handle that for you.

For more info please visit API Docmentation and PHPRad Documentation.

NOTE: PHPRad give a 30 day trial period to test out the product before purchase.

Re: PHPRad newbie with a lot of questions: Internationalization, API RESTFUL, etc.

Reply #4
Ok. Tx.. .understand it all now!
Wemerson Guimaraes
Brazil