Welcome Guest, Not a member yet? Register   Sign In
Can I use system variables or functions if using view parser
#2

(04-24-2019, 09:50 PM)markir Wrote: - The input form example wants to display validation errors using validation_errors() function. Cam this be called/shown is a view rendered via the parser library? Or do we have to collect any errors in a parser friendly format and inject them as 'data'?

IMO, there is no problem using functions from the Form Helper, URL Helper, or well... any "Helper" in a view file - with or without using the template parser. For the most part, those functions are returning strings of HTML which really isn't much different from what some of the more advanced template engines offer. So, if you're wanting to use the following, do it.

PHP Code:
<?php echo form_error('username'); ?>


(04-24-2019, 09:50 PM)markir Wrote: - It would be good reference base_url in the for input view, instead of just hoping that relative paths work ok - is this possible?

If you are asking if it is OK to use base_url() in a view I say, Absolutely. That said, there is a bit of overhead in using that helper function. If you need to use that value multiple times It can be a lot more efficient to capture the return of base_url() in a variable instead of repeated calls to the function.
Reply


Messages In This Thread
RE: Can I use system variables or functions if using view parser - by dave friend - 04-25-2019, 07:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB