Skip to content

Instantly share code, notes, and snippets.

View aronbudinszky's full-sized avatar

Aron Budinszky aronbudinszky

View GitHub Profile
@aronbudinszky
aronbudinszky / _index.html
Last active January 4, 2016 09:29
A description of the Respond.js 1.4.1 bug seen in IE8.
<!DOCTYPE html>
<html>
<head>
<!-- meta tags -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="bootstrap.min.css" rel="stylesheet">
<!-- Rendering of colums below not work with min + Respond 1.4, works fine with Respond 1.3 -->
@aronbudinszky
aronbudinszky / _menu.html
Last active April 10, 2016 22:13
An example of how to use the DRY principle in menus with the Outlast Framwork template language.
<div class="menu">
<a {% if not active %}class="active"{% endif %} href="{{oaappurl}}page=kezdo">Kezdőoldal</a>
<a {% if active = 'jatek' %}class="active"{% endif %} onclick="oa.accept('{{oaappctl}}page=jatek')">Játék</a>
<a {% if active = 'borito' %}class="active"{% endif %} onclick="oa.accept('{{oaappctl}}page=boritoim')" >Borítóképeim</a>
<a {% if active = 'toplista' %}class="active"{% endif %} href="{{oaappurl}}page=toplista">Toplista</a>
<a {% if active = 'nyeremeny' %}class="active"{% endif %} href="{{oaappurl}}page=nyeremeny">Nyeremények</a>
</div>
@aronbudinszky
aronbudinszky / categories.html
Last active April 10, 2016 22:13
This is a demo of using recursive template inclusion in Outlast Framework to display nested categories.
<h1>Categories</h1>
{% block catlist %}
<ul>
{% foreach categories as cat %}
<li>
<a href="{{baseurl}}categories/{{cat.friendlyurl}}">{{cat.name}}</a>
{% if cat.data.subcategories.total > 0 %}
{% with categories=cat.data.subcategories %}
{% insert 'categories.html' 'catlist' %}
@aronbudinszky
aronbudinszky / sample.model.php
Created May 2, 2014 08:29
Sample model for OFW.
<?php
/**
* This is just a sample model file. You can (and should) delete this once you start developing your app.
* @package Model
* @subpackage Example
*/
/**
* Documentation of cached fields and the data object.
@aronbudinszky
aronbudinszky / onetomany.html
Last active August 29, 2015 14:00
An example of accessing many-to-one relationship data in Outlast Framework.
<!-- Template system example -->
Fans of {{band.name}}:
{% foreach band.data.bigfans as fan %}
{{fan.name}} is a big fan!<br/>
{% elsefor %}
{{band.name}} has no big fans. :(
{% endfor %}
@aronbudinszky
aronbudinszky / manytoone.html
Last active August 29, 2015 14:00
An example of accessing many-to-one relationship data in Outlast Framework.
<!-- Template system example -->
My favorite band is {{user.data.myfavorite.name}}<br/>
<br/>
Others who like this band are:<br/>
{% foreach user.data.myfavorite.data.bigfans as fan %}
{% if user.id != fan.id %}{{fan.name}} is a big fan!<br/>{% endif %}
{% endfor %}
@aronbudinszky
aronbudinszky / 1. response.php
Last active August 29, 2015 14:01
A successful json response to an Outlast Framework form ajax request.
<?php
$this->zajlib->json(array('status'=>'ok'));
@aronbudinszky
aronbudinszky / 1. response-error.php
Last active August 29, 2015 14:01
An example of an form validation response to an Outlast Framework form ajax request.
<?php
/** This will display an alert message and highlight the fields by adding the has-error class to each. */
$this->zajlib->json(array(
'status'=>'error',
'message'=>'An optional message that will be displayed to the user.',
'highlight'=>array('name','email')
));
@aronbudinszky
aronbudinszky / email.field.php
Created May 25, 2014 14:26
Sample validation method for a mock email field definition class.
<?php
/**
* Field definition for dates.
* @package Fields
* @subpackage BuiltinFields
**/
zajLib::me()->load->file('/fields/text.field.php');
class zajfield_email extends zajfield_text {
@aronbudinszky
aronbudinszky / 1. single-validation.php
Last active August 29, 2015 14:01
An example of automatically validating a single field or many fields with Outlast Framework while specifying the error messages to be used if validation fails.
<?php
// Validate data automatically for a single field 'email' in the model FormSignup
$this->zajlib->form->validate('FormSignup', 'email', 'Invalid email address specified!');