As answered by @bostaf in the post loading configuration information in to the library;
Unexpected T_VARIABLE is a parse error,
meaning that code syntax or structure is not valid.
This error usually occurs because of missing semicolon or bracket
somewhere before it's triggered.
THIS (sic!), I understand implicitly. I have also consulted every test-case listed under the T_VARIABLE primer in PHP Parse/Syntax Errors; and How to solve them? as well as browsed intently through any and all related questions in the sidebar, but I have a feeling it's either so simple I'm just missing it, or there's something else at play. The error message: Message: syntax error, unexpected '$this' (T_VARIABLE)
- the source of the error;
class Upload extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library(array('session','ion_auth'));
$this->load->helper(array('form', 'url')); //error line HERE
$this->load->model('User_profile_model', 'User_profile', TRUE);
}
}
THIS coding shouldn't be erroring whatsoever as I have the same opening on several pages of this app (had an unexpected ' function' (T_VARIABLE)
before due to the line space between the class declaration and function __construct() line) and none of the stated T_VARIABLE errors exist;
1) Missing semicolon/braces: ALL loaders lines terminate with the required semi-colon (and there are only two brackets for the function __construct()
).
2) String concatenation: Not using .
anywhere, so that's not an issue.
3) Missing expression operators: No expressions/regexes used, so no issue there.
4) Lists: Using arrays for libraries and helpers, but CI docs say I'm good for that particular formatting, and I've triple-checked this aspect.
5) Class Declarations: No, no...no probs there.
6) Variables after identifiers and 7) Missing parens after language constructs have no play (unless I went blind and missed something COMPLETELY obvious...
I really have no ken of what the actual issue could be as this exact codeblock starts numerous pages, and I've rechecked the ones that do to no effect. Like I said, it's super-clear and I'm missing it, or there may be another factor at play here.