Welcome Guest, Not a member yet? Register   Sign In
Check folder
#1

[eluser]my9006ci[/eluser]
hi,

i want detect the folder in
Code:
http://localhost/codeigniter/themes/folder

I want to make my own library, like this
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class theme {

    var $CI = null;
    function theme()
    {
        $this->CI =& get_instance();
        $this->CI->config->load('configsite');
        $this->CI->load->helper('path');
        $tema = $this->CI->config->item('theme');
        $string = set_realpath('themes/'.$tema,FALSE);
        if ($string)
        {
            echo 'themes/'.$tema.'/';
        }
        else
        {
            echo 'cant load the theme';
            exit;
        }
    }
}
?>

what should I use as a helper?
whether the file helper, or path helper
then how to use it

many thanks...
#2

[eluser]WanWizard[/eluser]
To check if a directory exists, a simple
Code:
if ( is_dir($my_directory) )
{
    echo "yeah, I found it!";
}
else
{
    echo "directory doesn't exist!";
}
would do the trick.
#3

[eluser]my9006ci[/eluser]
[quote author="WanWizard" date="1273841564"]To check if a directory exists, a simple
Code:
if ( is_dir($my_directory) )
{
    echo "yeah, I found it!";
}
else
{
    echo "directory doesn't exist!";
}
would do the trick.[/quote]

@WanWizard : thanks ...




Theme © iAndrew 2016 - Forum software by © MyBB