Skip to content

Instantly share code, notes, and snippets.

@hassadee
Last active September 9, 2017 02:57
Show Gist options
  • Select an option

  • Save hassadee/ee7ae5136b60ea904185 to your computer and use it in GitHub Desktop.

Select an option

Save hassadee/ee7ae5136b60ea904185 to your computer and use it in GitHub Desktop.

Revisions

  1. hassadee revised this gist Sep 9, 2017. 3 changed files with 37 additions and 1 deletion.
    1 change: 0 additions & 1 deletion TEST
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    TEST
    23 changes: 23 additions & 0 deletions Tools.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    /**
    * Get CMS Title.
    */
    public static function getCMSTitle($id_cms,$id_lang){
    $cms = new CMS($id_cms, $id_lang);
    return $cms->meta_title;
    }

    /**
    * Get CMS Description.
    */
    public static function getCMSDescription($id_cms, $id_lang){
    $cms = new CMS($id_cms, $id_lang);
    return $cms->meta_description;
    }

    /**
    * Get CMS Content.
    */
    public static function getCMSContent($id_cms, $id_lang){
    $cms = new CMS($id_cms, $id_lang);
    return $cms->content;
    }
    14 changes: 14 additions & 0 deletions template.tpl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    {*
    * Usage (Get title): Tools::getCMSTitle($id_cms, $cookie->id_lang)
    * Usage (Get Description): Tools::getCMSDescription($id_cms, $cookie->id_lang)
    * Usage (Get Content): Tools::getCMSContent($id_cms, $cookie->id_lang)
    *}

    {* Get CMS Title *}
    {Tools::getCMSTitle(1, $cookie->id_lang)}

    {* Get CMS Description *}
    {Tools::getCMSDescription(1, $cookie->id_lang)}

    {* Get CMS Content *}
    {Tools::getCMSContent(1, $cookie->id_lang)}
  2. Hassadee Pimsuwan created this gist Mar 3, 2011.
    1 change: 1 addition & 0 deletions TEST
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    TEST