Atomik Framework 2.2 Manual


Table of Contents

1. Introduction
2. Core principles
Simplicity and the KISS principle
Ready to run
Actions and Views
Extensibility and Plugins
3. Installation
Requirements
Download
Installation
More about the directory structure
4. The global store
Accessing the store
Using paths in keys
Using accessors with any array
5. Configuration
Configuration file
Bootsrapping
Custom directory structure
Pre and post dispatch files
Custom error pages
Advanced configuration
6. URLs
Calling an action
Routing urls
Creating routes
Retrieving route parameters
File extensions
Building urls with Atomik::url()
7. Actions
Introduction to separation of application logic and presentation
Action files
Actions and HTTP methods
Targeting HTTP methods
Allowed methods and overriding the request's method
Using classes to define actions
Calling actions programmatically
8. Views and layouts
Views
Helpers
Creating helpers
Using helpers
Layout
View contexts
Controlling views
View's filename extension
Do not render the view from the action
Modify the associated view from the action
Using a custom rendering engine
Rendering views programmatically
9. Selectors and methods
Methods
10. Session
Starting and accessing the session
Flash messages
11. Includes
12. Utilities
Redirections and 404 errors
Escaping text
Friendly urls
Filtering and validating data
Managing paths
13. Error handling, logging and debugging
Handling errors
Logging
Debugging
14. Events
Listening to events
Firing events
Events naming convention
Overview of available Atomik events
15. Using plugins
Installing a plugin
Activating and configuring a plugin
Pluggable applications
Activating and accessing pluggable applications
Overrides
16. Developing plugins
The plugin file
Plugin's custom configuration
Using a class
Pluggable applications
Plugin's assets and urls
Manifest.xml
Loading plugins programmaticaly
A. Update from 2.1 to 2.2
Configuration
New features

List of Figures

3.1. The default directory structure
5.1. The default configuration for directories
8.1. A little schema to sum up!
14.1. Simple schema illustrating Atomik events flow (simplified)
16.1. A pluggable application directory structure

List of Examples

4.1. Using the get method
4.2. Using the set method
4.3. Using the add method
4.4. Using the has and delete methods
4.5. Using paths
4.6. Using paths when setting values
4.7. Using accessors with any array
5.1. PHP configuration (app/config.php)
5.2. INI configuration (app/config.ini)
5.3. JSON configuration (app/config.json)
5.4. Creating custom distribution
6.1. Simple route
6.2. A route with some parameters
6.3. A named route
6.4. A route with some parameters
6.5. A route with some parameters
6.6. URLs with extension example
6.7. Routes with extension
6.8. Building simple urls
6.9. Building urls with parameters
6.10. Building urls with embedded parameters
6.11. Building urls using named routes
6.12. Urls relativity
7.1. A php script, the old way
7.2. Splitting into multiple files
7.3. Private variables in actions
7.4. Actions and folders
7.5. Using a class in your action
7.6. Using a class in an action located in a sub folder or targeting an HTTP method
7.7. Setting view variables with action classes
7.8. Calling an action programmatically
7.9. Calling an action for a specific method programmatically
8.1. Example of a view
8.2. Creating an helper
8.3. Calling an helper
8.4. Example layout
8.5. Creating a custom view context
8.6. Using a custom rendering engine
8.7. Rendering a view programmatically
9.1. Using the flash selector
9.2. Using the selector provided by the Db plugin
9.3. Registering a selector
9.4. Registering a method
9.5. Calling a method
9.6. Calling a method using Atomik::call()
10.1. Accessing the session from the global store
10.2. Creating flash messages
10.3. Retreiving flash messages
11.1. Using includes
11.2. Including classes with their name
12.1. Redirecting
12.2. Trigerring a 404 error
12.3. Escaping text
12.4. Escaping text using different profiles
12.5. Make an url friendly string
12.6. Filtering data
12.7. Filtering arrays
12.8. Using Atomik::path() with paths
12.9. Using Atomik::path() to find files
13.1. Using Atomik::log()
13.2. Creating a custom logger
13.3. Using Atomik::debug()
14.1. Listening to an event
14.2. Listeners with priorities
14.3. Listeners with priorities and importance
14.4. Firing events
14.5. Callback results after firing events
14.6. Example of event naming
15.1. Activating a plugin
15.2. Plugin with custom configuration
15.3. Setting the trigger for the Blog plugin
15.4. Manually setting the trigger
15.5. Overriding a view from the Blog plugin
16.1. Retrieving plugin custom configuration
16.2. Plugin class
16.3. Plugin class with event callback methods
16.4. Example of a Plugin.php file registering a pluggable application
16.5. Using Atomik::asset()
16.6. Loading a plugin
16.7. Loading a plugin at runtime with some configuration
16.8. More advance use of Atomik::loadCustomPlugin()
16.9. Checking if a plugin is already loaded

The manual is licensed under the Creative Commons Attribution 3.0 License.

The manual targets Atomik 2.2.