pswork Posted June 23, 2021 Share Posted June 23, 2021 {if isset($sections) && $sections} {foreach from=$sections key=keySection item='section'} {if isset($section.hook) && $section.hook === $hook} {/if} {/foreach} {/if} do i need to check every time isset($section.hook) if it is a child already checked isset($sections)? Link to comment Share on other sites More sharing options...
delete-account-pleas Posted June 23, 2021 Share Posted June 23, 2021 (edited) 35 minutes ago, pswork said: {if isset($sections) && $sections} {foreach from=$sections key=keySection item='section'} {if isset($section.hook) && $section.hook === $hook} {/if} {/foreach} {/if} do i need to check every time isset($section.hook) if it is a child already checked isset($sections)? The best practice is to do this. Unless your 100% sure that if $sections is set de sub variables are always filled. If a variable is called which is not set a error will be displayed. Edited June 23, 2021 by Crezzur (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now