• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parser error :(

#1
[eluser]Lazos[/eluser]
Hi I have this array $directory that I am collecting data. The result of this array is not the same as the one they use in the User Guide of CI?

I am getting this error and I do not know why.
A PHP Error was encountered

Severity: Warning

Message: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 2

Filename: libraries/Parser.php

Line Number: 161

Any help?

My array.
Code:
$i = 0;
        while (false !== ($file = readdir($dh))){
            if(!in_array($file, $ignore)){  
                if(is_dir($path.'/'.$file)){
                    if ($file == '..' && (($path != $this->imagepath) || ($path != $this->root))) {
                    $directory['repeat'][$i]['I_DIRECTORY'] = '<a href="'.base_url().'index.php/admin/imagemanager?dir='.$back.'" title="Go Back">'.$this->CI->admin_theme->displayImage('images/admin/filemanager/32px/dir.png', 'Go Back', '','','').'</a>';
                    $directory['repeat'][$i]['V_FILENAME'] = $file;
                    $directory['repeat'][$i]['V_FILEOWNER'] = '&nbsp;';
                    $directory['repeat'][$i]['V_PERMS'] = '&nbsp;';
                    $directory['repeat'][$i]['V_SIZE'] = '&nbsp;';
                    $directory['repeat'][$i]['V_DATE'] = '&nbsp;';
                    $directory['repeat'][$i]['I_DELETE'] = '&nbsp;';
                    $directory['repeat'][$i]['I_CHANGEPERMS'] = '&nbsp;';
                    $directory['repeat'][$i]['I_DELETE'] = '&nbsp;';
                    $directory['repeat'][$i]['I_LOCK'] = '&nbsp;';
                    
                    }
                    if ($file != '..') {
                    $directory['repeat'][$i]['img'] = '<a href="'.base_url().'index.php/admin/imagemanager?dir='.$back.'" title="Go Back">'.$this->CI->admin_theme->displayImage('images/admin/filemanager/32px/dir.png', 'Go Back', '','','').'</a>';
                    $directory['repeat'][$i]['V_FILENAME'] = $file;
                    $directory['repeat'][$i]['V_FILEOWNER'] = '&nbsp;';
                    $directory['repeat'][$i]['V_PERMS'] = '&nbsp;';
                    $directory['repeat'][$i]['V_SIZE'] = '&nbsp;';
                    $directory['repeat'][$i]['V_DATE'] = '&nbsp;';
                    $directory['repeat'][$i]['I_DELETE'] = '&nbsp;';
                    $directory['repeat'][$i]['I_CHANGEPERMS'] = '&nbsp;';
                    $directory['repeat'][$i]['I_DELETE'] = '&nbsp;';
                    $directory['repeat'][$i]['I_LOCK'] = '&nbsp;';
                    }
                }        
        $i++;    }
        }


Code Igniter Example
Code:
$data = array(
              'blog_title'   => 'My Blog Title',
              'blog_heading' => 'My Blog Heading',
              'blog_entries' => array(
                                      array('title' => 'Title 1', 'body' => 'Body 1'),
                                      array('title' => 'Title 2', 'body' => 'Body 2'),
                                      array('title' => 'Title 3', 'body' => 'Body 3'),
                                      array('title' => 'Title 4', 'body' => 'Body 4'),
                                      array('title' => 'Title 5', 'body' => 'Body 5')
                                      )
            );

$this->parser->parse('blog_template', $data);

My Template
Code:
{repeat}
    <tr class="row1">
        <td valign="middle"><a href="{U_DIR}"><img height="32" style="border:0;" src="{I_DIRECTORY}" alt="directory" align="middle" /></a></td>
        <td valign="middle"><a href="{U_NAME}">{V_FILENAME}</a></td>
        <td style="padding-right:8px;" valign="middle">{V_FILEOWNER}</td>
        <td style="padding-right:8px;" valign="middle">{V_PERMS}</td>
        <td style="padding-right:2px;text-align:right;" valign="middle">{V_SIZE}</td>
        <td style="padding-right:8px;" valign="middle">&nbsp;</td>
        <td style="padding-right:8px;" valign="middle">{V_DATE}</td>
        <td valign="middle">
            <table cellspacing="0" border="0">
                <tr>    
                    <td valign="middle">{I_RENAME}</td>
                    <td valign="middle">{I_CHANGEPERMS}</td>
                    <td valign="middle">{I_DELETE}</td>
                    <td valign="middle">{I_LOCK}</td>
                </tr>
            </table>    
        </td>
        <td>&nbsp;</td>
    </tr>
    {/repeat}


Messages In This Thread
Parser error :( - by El Forum - 11-12-2008, 09:22 AM
Parser error :( - by El Forum - 10-12-2009, 09:42 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.