Skip to content

Instantly share code, notes, and snippets.

@jsvensson
Created December 3, 2012 22:48
Show Gist options
  • Select an option

  • Save jsvensson/4198846 to your computer and use it in GitHub Desktop.

Select an option

Save jsvensson/4198846 to your computer and use it in GitHub Desktop.

Revisions

  1. jsvensson revised this gist Dec 3, 2012. 1 changed file with 0 additions and 9 deletions.
    9 changes: 0 additions & 9 deletions php-highlight.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,3 @@
    ---
    layout: post
    title: "Building a user management system using Laravel"
    date: 2012-11-24 22:10
    comments: true
    categories: [php, laravel]
    published: true
    ---

    # Triple backticks #

    With opening tag, no closing tag
  2. jsvensson created this gist Dec 3, 2012.
    151 changes: 151 additions & 0 deletions php-highlight.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,151 @@
    ---
    layout: post
    title: "Building a user management system using Laravel"
    date: 2012-11-24 22:10
    comments: true
    categories: [php, laravel]
    published: true
    ---

    # Triple backticks #

    With opening tag, no closing tag

    ``` php
    <?php
    public function __construct(){
    parent::__construct();
    }
    ```

    With both opening/closing tag

    ``` php
    <?php
    public function __construct(){
    parent::__construct();
    }
    ?>
    ```

    No opening/closing tag

    ``` php
    public function __construct(){
    parent::__construct();
    }
    ```

    No opening/closing tag, full Class syntax

    ``` php
    class Foo extends Bar
    {
    public function __construct(){
    parent::__construct();
    }
    }
    ```

    With opening/closing tag, full Class syntax

    ``` php
    <?php
    class Foo extends Bar
    {
    public function __construct(){
    parent::__construct();
    }
    }
    ?>
    ```

    Partial code

    ``` php
    function Dbug() { }

    function inspect($var,$forceType="",$bCollapsed=false) {
    ...
    ```

    ``` php
    // Empty constructor for CodeIgniter
    function Dbug() { }

    // Rename the original constructor
    function inspect($var,$forceType="",$bCollapsed=false) {
    ...
    ```


    # Using codeblock plugin #

    With opening tag, no closing tag

    {% codeblock lang:php %}
    <?php
    public function __construct(){
    parent::__construct();
    }
    {% endcodeblock %}
    With both opening/closing tag
    {% codeblock lang:php %}
    <?php
    public function __construct(){
    parent::__construct();
    }
    ?>
    {% endcodeblock %}

    No opening/closing tag

    {% codeblock lang:php %}
    public function __construct(){
    parent::__construct();
    }
    {% endcodeblock %}

    No opening/closing tag, full Class syntax

    {% codeblock lang:php %}
    class Foo extends Bar
    {
    public function __construct(){
    parent::__construct();
    }
    }
    {% endcodeblock %}

    With opening/closing tag, full Class syntax

    {% codeblock lang:php %}
    <?php
    class Foo extends Bar
    {
    public function __construct(){
    parent::__construct();
    }
    }
    ?>
    {% endcodeblock %}

    Partial code

    {% codeblock lang:php %}
    function Dbug() { }

    function inspect($var,$forceType="",$bCollapsed=false) {
    ...
    {% endcodeblock %}

    {% codeblock lang:php %}
    // Empty constructor for CodeIgniter
    function Dbug() { }

    // Rename the original constructor
    function inspect($var,$forceType="",$bCollapsed=false) {
    ...
    {% endcodeblock %}