ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Equivalent to path="tmplgrp/templ" for use in PHP

July 24, 2008 1:15pm

Subscribe [2]
  • #1 / Jul 24, 2008 1:15pm

    Erik Stainsby

    9 posts

    Hi,
    Writing a plugin for building menus out and need to find equivalent call for use in the PHP code.  Wish to grab the site uri, up to and including the index script name that a configured site is using. 

    Using CodeIgniter there is a set of class libraries to expose such functionality.  Scanning the Developer Docs for EE, I’m not finding the same level of utility exposure. Hence, my question.

    tia,
    Erik

  • #2 / Jul 24, 2008 2:08pm

    Greg Aker

    6022 posts

    I think you can get it done with the Functions Class

    <?php
    
    global $FNS;
    
    $FNS->fetch_site_index();

    Hope that helps,

    -greg

    Hi,
    Writing a plugin for building menus out and need to find equivalent call for use in the PHP code.  Wish to grab the site uri, up to and including the index script name that a configured site is using. 

    Using CodeIgniter there is a set of class libraries to expose such functionality.  Scanning the Developer Docs for EE, I’m not finding the same level of utility exposure. Hence, my question.

    tia,
    Erik

  • #3 / Jul 24, 2008 2:12pm

    Ingmar

    29245 posts

    If you want to use EE, as it were, it’s in the Functions class:

    <?php global $FNS;
    echo $FNS->fetch_current_uri(); ?>
  • #4 / Jul 25, 2008 3:40pm

    Erik Stainsby

    9 posts

    Thanks gang.  The final solution to exactly what I wanted to achieve is:

    <?php 
    
    global $FNS;
    
    $key = $FNS->fetch_current_uri();
    if ($FNS->extract_path($key) != '' && $FNS->extract_path($key) != 'SITE_INDEX')
    {
        $path = $FNS->extract_path($key);
    }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases