Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/level-level/clarkson-core
A plugin to write Object-Oriented code in combination with the Twig templating engine while keeping the WordPress Way of working in mind.
https://github.com/level-level/clarkson-core
clarkson level-level plugin template theming-layer twig wordpress wordpress-objects
Last synced: 7 days ago
JSON representation
A plugin to write Object-Oriented code in combination with the Twig templating engine while keeping the WordPress Way of working in mind.
- Host: GitHub
- URL: https://github.com/level-level/clarkson-core
- Owner: level-level
- Created: 2015-04-17T14:46:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-19T15:34:17.000Z (17 days ago)
- Last Synced: 2024-12-22T10:09:55.542Z (14 days ago)
- Topics: clarkson, level-level, plugin, template, theming-layer, twig, wordpress, wordpress-objects
- Language: PHP
- Homepage: https://level-level.github.io/Clarkson-Core/phpdoc/guide/index.html
- Size: 1.13 MB
- Stars: 24
- Watchers: 12
- Forks: 10
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Test](https://github.com/level-level/Clarkson-Core/actions/workflows/test.yml/badge.svg)](https://github.com/level-level/Clarkson-Core/actions/workflows/test.yml)
# Clarkson Core
A plugin to write Object-Oriented code in combination with the Twig templating engine while keeping the WordPress Way of working in mind.## Documentation and getting started
Check out the [getting started with Clarkson Core guide](https://level-level.github.io/Clarkson-Core/phpdoc/guide/index.html) if you are just getting to know the project.## Overview
### Installation
```
composer require level-level/clarkson-Core
```or read the [installation guide](https://level-level.github.io/Clarkson-Core/phpdoc/guide/getting-started/installation.html).
### Template Hierachy
Uses the internal [Template Hierarchy](https://level-level.github.io/Clarkson-Core/phpdoc/guide/getting-started/templating.html) so you can replace `index.php` with `index.twig` or `archive-company.php` with `archive-company.twig` and still have all Posts or CPT's available in "The Loop".```twig
{% extends "layouts/full-width.twig" %}{% block content %}
{% for object in objects %}
{% include 'partials/teaser.twig' %}
{% endfor %}
{% endblock %}
```### Autoloading of WordPress-object classes per Custom Post Type.
It autoloads default objects that behave just like `WP_Post` and other native WordPress object but with some more handy stuff.
When you register a Custom Post Type `ll_company` your custom class `ll_company` gets loaded in the Twig context as `objects` variable within the `archive-company.twig`.Read up on [Clarkson objects and how they are initiated](https://level-level.github.io/Clarkson-Core/phpdoc/guide/getting-started/clarkson-objects.html).
## More documentation
- [Actions & filters](https://level-level.github.io/Clarkson-Core/hooks/)
- [Reference](https://level-level.github.io/Clarkson-Core/phpdoc/namespaces/clarkson-core.html)
- [Legacy documentation](https://github.com/level-level/Clarkson-Core/wiki)## Tests
Currently
1. Clone repository `[email protected]:level-level/Clarkson-Core.git clarkson-core`.
1. Run `composer install` in the new `clarkson-core` directory.
1. Run `composer run test`.