Development
These FAQs briefly summarise key concepts regarding developing with Composr and how to use its framework.
For more information, check out these tutorials:
Note that these FAQs only cover the introduction section of the codebook. The tutorial linked above contains a Table of Contents for more advanced concepts.
For more information, check out these tutorials:
- Introduction to programming
- The Composr programming framework
- JavaScript Reference
- Code Book, contents and introduction
Note that these FAQs only cover the introduction section of the codebook. The tutorial linked above contains a Table of Contents for more advanced concepts.
Question | What are the main components of the Composr framework? |
---|---|
Answer | Composr consists of:
|
Question | How can I customize Composr without modifying the core files? |
---|---|
Answer | Composr offers a robust override system. Instead of altering the original files, create a parallel structure within _custom directories. For example, to modify site/pages/modules/polls.php, place your customized version in site/pages/modules_custom/polls.php. The tutorials outline additional information on how to utilise overrides. |
Question | What are the different ways to extend Composr functionality? |
---|---|
Answer | You can extend Composr through:
|
Question | Can you give an example of creating a new module? |
---|---|
Answer | Imagine creating a "Testing" module to manage collaborative testing:
|
Question | How can I export and import custom addons? |
---|---|
Answer | Composr allows exporting addons as TAR files, containing all necessary files and an addon.inf file for metadata. You can import these addons to share and reuse them across different Composr installations. To do this, make your necessary files for the addon in the Composr installation, and then go under Admin Zone > Structure > Addons > Export addon. You can select the relevant files for the addon, provide information about the addon, and then download the TAR file (which can then be imported on other Composr sites). |
Question | What is the purpose of the Code Editor? |
---|---|
Answer | The Code Editor is a web-based tool for editing Composr code files directly on the server. It requires password authentication and automatically manages overrides within _custom directories. To access it, go to yourbaseurl/code_editor.php. |
Question | Where can I find resources for learning PHP programming? |
---|---|
Answer | While Composr documentation doesn't cover basic PHP, resources like the official PHP documentation ( |
Question | What are some key coding standards in Composr? |
---|---|
Answer | Composr emphasizes clean, well-structured code with a focus on readability and maintainability. Key standards include proper indentation, consistent use of comments, and clear function headers with type definitions. Remember: beautiful code leads to better functionality and collaboration! |
Question | What tools are available for debugging Composr code? |
---|---|
Answer | Composr offers a code quality checker addon that helps identify various types of errors, including parser errors, run-time errors, and logical errors. This tool can significantly reduce debugging time and enhance code reliability. It is available through the testing_platform addon. |
Question | How does Composr implement the Model-View-Controller (MVC) pattern? |
---|---|
Answer |
|
Question | What are the advantages of using Composr's JavaScript libraries? |
---|---|
Answer | Composr's JavaScript libraries like $cms, $util, and $dom offer several advantages:
|
Question | How do data-tpl and data-view behaviors work in Composr's JavaScript? |
---|---|
Answer | Composr uses data-tpl and data-view behaviors for associating HTML templates and JavaScript views, respectively. This facilitates clean separation of presentation and logic:
|