Categories > TinyButStrong general >

ignore all errors

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: tjitte
Date: 2006-01-24
Time: 12:53

ignore all errors


Hello,

Is there anyway to ignore all errors at once?

For example something like this:

$errors=False;

$Temp->LoadTemplate("",$errors);

So you can set all error messages off at once, in stead of using noerr on all var....

Thanks...

Greetings,
Tjitte




By: Skrol29
Date: 2006-01-24
Time: 14:54

Re: ignore all errors

Hello,

There is no such thinks on TBS 2.x. It's on study for TBS 3.0 but not sure yet. It's easy to add, but this will make problems for users. They may be won't understand why the template is not working.
By: tjitte
Date: 2006-01-24
Time: 15:10

Re: ignore all errors

Thx for the reply!

Can you give me a example on how to change the code to get a function like this?

I'm currently working with forms and returned formdata.
In order to make it easy for people to edit the html this would be a nice function.
 
Thx in advance...

By: Skrol29
Date: 2006-01-24
Time: 15:37

Re: ignore all errors

Hello, here is how to do:
class clsTinyButStrong {
  ...
  var $NoErr = false; // add this line in the public properties
  ...
  function meth_Misc_Alert(...) {
    if ($this->NoErr) return false; // add this line at the first line of the method
    ...
  }
  ...
}

Then in your application, you just have to set $TBS->NoErr = true; when you want to avoid TBS error messages.
By: tjitte
Date: 2006-01-26
Time: 10:05

Re: ignore all errors

Hoi Skrol29,

Thx for the solution its works but.... :-)

Now the tags just show in the page when they are empty.

example:

<input type="text" name="lastname" value="[var.lastname]" />

result = [var.lastname] in the input box.

Can I do something about this?

Cheers,
Tjitte



By: Skrol29
Date: 2006-01-31
Time: 19:50

Re: ignore all errors

Hello,

Sorry to be long on that.
You're rigth, I've forgotten somes few other changes.

In source of function meth_Merge_PhpVar(), you have to change any
if (isset($Loc->PrmLst['noerr'])) {...
into:
if ($this->NoErr or isset($Loc->PrmLst['noerr'])) {...
They should be 3 of, it closed to each other.