I just generated my first module, with 3 properties, and my first attempt to view the module resulted in an error.
Parse error: syntax error, unexpected 'Secondary' (T_STRING), expecting ')' in F:\xampp\htdocs\rig\modules\areacodes\controllers\Areacodes.php on line 118
That code is as follows...
[code]
function submit() {
$this->module('trongate_security');
$this->trongate_security->_make_sure_allowed();
$submit = post('submit', true);
if ($submit == 'Submit') {
$this->validation_helper->set_rules('primary_area_code', '"Primary Area Code"', 'required|max_length[3]|numeric|greater_than[0]|integer');
$this->validation_helper->set_rules('secondary_area_code', ' 'Secondary Area Code' ', 'required|max_length[3]|numeric|greater_than[0]|integer');
$this->validation_helper->set_rules('relation', ' 'Relation' ', 'required|min_length[1]|max_length[1]');
$result = $this->validation_helper->run();
[\code]
If you'll notice in the rules for Secondary Area Code and Relation, te inner set of quotes around the field labels should probably be double quotes. When I corrected that, it worked fine.
Not a question, but a bug report.
4 years ago
4 years ago
#1
4 years ago
#2
And then... I clicked on "Create New Areacode Record" which resulted in the following...
Parse error: syntax error, unexpected 'Primary' (T_STRING), expecting ')' in F:\xampp\htdocs\rig\modules\areacodes\views\create.php on line 11.
I tried to add more info but it keeps getting cut off.
Let us not judge others for being less than perfect.
On the manage page, "" tags do not require quotes around the labels.
It's starting to look that like someone coded up a function to handle the quotes, and that module needs some TLC.
Parse error: syntax error, unexpected 'Primary' (T_STRING), expecting ')' in F:\xampp\htdocs\rig\modules\areacodes\views\create.php on line 11.
I tried to add more info but it keeps getting cut off.
Let us not judge others for being less than perfect.
On the manage page, "" tags do not require quotes around the labels.
It's starting to look that like someone coded up a function to handle the quotes, and that module needs some TLC.
4 years ago
#3
Hello Charles,
Can you post lines 117 to 119 in your controller file?
I believe that you have to many quotes.
There should just be single quotes.
Not 2 pairs of single quotes or double quotes.
Dan
Can you post lines 117 to 119 in your controller file?
I believe that you have to many quotes.
There should just be single quotes.
Not 2 pairs of single quotes or double quotes.
Dan
4 years ago
#4
Hi Charles, welcome back.
I've never seen the Desktop App produce code like that before and I've created loads of apps using it.
If you could reproduce it in a video, I'd be interested to see it.
Obviously, the code you have in your controller has syntax errors:
1. The first validation rule is OK with the single wrapping the double quotes, but the double quotes are not necessary
2. The next 2 validation rules have syntax errors
It should read as follows:
Can I ask what text editor you are using, as the errors would be made obvious in something like VS Code or Sublime Text?
I've never seen the Desktop App produce code like that before and I've created loads of apps using it.
If you could reproduce it in a video, I'd be interested to see it.
Obviously, the code you have in your controller has syntax errors:
1. The first validation rule is OK with the single wrapping the double quotes, but the double quotes are not necessary
2. The next 2 validation rules have syntax errors
It should read as follows:
Can I ask what text editor you are using, as the errors would be made obvious in something like VS Code or Sublime Text?
4 years ago
#5
I have no idea how to close a thread.
I had to reduce my screen down to 67% to see the right side of the content.
I didn't even know you could pick a winning response.
I had to reduce my screen down to 67% to see the right side of the content.
I didn't even know you could pick a winning response.
4 years ago
#6
That's ok. Thanks for checking back to close it out.
Mobile devices do not keep the responses between the lines.
Dan
Mobile devices do not keep the responses between the lines.
Dan