Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
# Put this either in | |
# | |
# 1. a new file called ~/.bash_completion | |
# 2. your ~/.bashrc | |
# | |
_composer() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
local cmd=${COMP_WORDS[0]} |
# Capistrano Laravel 4 Deployment Tasks | |
# Watts Martin (layotl at gmail com) | |
# https://gist.github.com/chipotle/5506641 | |
# updated 14-Aug-2013 | |
# Assumptions: | |
# | |
# - You are using a .gitignore similar to Laravel's default, so your | |
# vendor directory and composer(.phar) are *not* under version control | |
# - Composer is installed as an executable at /usr/local/bin/composer |
<?xml version="1.0" encoding="UTF-8"?> | |
<currency source-url="http://themoneyconverter.com"> | |
<entry code="ARS" feed-location="/rss-feed/ARS/rss.xml"> | |
<name>Argentine Peso</name> | |
<unicode> | |
<decimal>36</decimal> | |
<hex>24</hex> | |
</unicode> | |
</entry> | |
<entry code="AWG" feed-location="/rss-feed/AWG/rss.xml"> |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
## SOURCE: xe.com | |
--> | |
<currency-symbol count="115"> | |
<entry code="ALL" unicode-decimal="76, 101, 107" unicode-hex="4c, 65, 6b">Albania Lek</entry> | |
<entry code="AFN" unicode-decimal="1547" unicode-hex="60b">Afghanistan Afghani</entry> | |
<entry code="ARS" unicode-decimal="36" unicode-hex="24">Argentina Peso</entry> | |
<entry code="AWG" unicode-decimal="402" unicode-hex="192">Aruba Guilder</entry> | |
<entry code="AUD" unicode-decimal="36" unicode-hex="24">Australia Dollar</entry> |
This is all still a little new to me, so forgive me if this sounds naive, or you all have already thought about this and it's obvious, but I've been thinking about how we actually build Next. (I like this as a project codename).
<?php | |
/** | |
* Array2XML: A class to convert array in PHP to XML | |
* It also takes into account attributes names unlike SimpleXML in PHP | |
* It returns the XML in form of DOMDocument class for further manipulation. | |
* It throws exception if the tag name or attribute name has illegal chars. | |
* | |
* Author : Lalit Patel | |
* Website: http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes | |
* License: Apache License 2.0 |
<?php | |
# | |
# INSPIRATION FROM Nick Dunn (in the Symphony CMS forum) | |
# "Convert a Directory of Markdown Text Files for Dynamic XML Datasource Use" | |
# http://getsymphony.com/discuss/thread/60701/#position-2 | |
# | |
# AND FROM Stack Overflow | |
# http://stackoverflow.com/questions/8545010/php-reading-first-2-lines-of-file-into-variable-and-cylce-through-subfolders/8545451#8545451 | |
# |
<?php | |
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php | |
/** | |
* The root directory where the repos live. | |
* | |
* @var string | |
*/ | |
$root_dir = '/your/root/dir/'; |
{!-- Wrapper template --} | |
{stash:embed:layouts:product} | |
{!-- Custom field prefix --} | |
{preload_replace:cf="cf_product_"} | |
{exp:channel:entries | |
channel="products" | |
url_title="{segment_2}" | |
limit="1" |