Entity Demo

Welcome to this custom Entity Framework demo

Below you should find a custom widget that translates text via a CURL rest API.

This represent and example of how our Framework works, and gives you an example to work with completing the development tasks listed below.

Please read the entire page, and complete the Development Tasks found below. You can zip the code up and email it back once complete.

Translator Widget

Translate
Your translation will appear here!

RageMP Server Widget

Get information
Your server information will appear here!
All servers can be found: https://rage.mp/masterlist/
An example: 89.163.140.250:22005

How it works

To the left is a custom widget called an Entity.
In our framework, we package up the CSS, HTML, PHP and Javascript in to one module.

  • CSS = Less Stylesheet
  • HTML = TWIG view
  • Javascipt = Client side logic
  • PHP = Server side logic

This allows us to create and re-use elements, prototype and create test driven applications that are fast, reliable and secure.

As a developer this allows you to spend more time on building features rather than re-inventing the wheel.

Development Tasks

  • 1. Add another language to Translator widget.

  • 2. Make the Translator widget translate the text when the language is changed.

  • 3. Improve the styling, user feedback and improve in anyway you can.

Advanced
  • 4. Add TextToSpeech to convert the translated text in to an Audio output.

  • 5. Create your own Entity Widget that does something unique.

References / Documentation

Technologies used within the Framework.

  • Less: http://lesscss.org/
  • TWIG: https://twig.symfony.com

Entity Framework

Think of every Entity as a control or a widget. The PHP defines what it is and does any server side logic. Every Entity has a client side equivalent, these work in harmony and create an object that can be re-used.

The framework does all the AJAX / communications for you.

You have to import and export functions within the PHP setup function.

Importing Methods

An imported method is a Javascript function that is now available within the PHP function. It opens up access to the server side logic (PHP) to be able to call it.

Exporting Methods

An imported method is a Javascript function that is now available within the PHP function. It opens up access to the server side logic (PHP) to be able to call it.

How it works

The object is "compiled" in to /assets/generated/entity.js and /assets/generated/entity.css, which is loaded by the client side browser.

The Javascript object is created when it's displayed, and can be accessed by it's name through the terminal like so: