Skip to content

Instantly share code, notes, and snippets.

@Uriel29
Last active June 13, 2016 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Uriel29/1eb03d7067fbe2f89d1e to your computer and use it in GitHub Desktop.
Save Uriel29/1eb03d7067fbe2f89d1e to your computer and use it in GitHub Desktop.
verificar se um campo tem um dado, caso não tenha execute uma ação!
//Ver se campo tem conteúdo!
<?php if($cck->get('campo')->value) { ?>
// se o campo tiver algo faça. Aqui não mostra nada, mas pode ter qualquer coisa!
<?php } else { ?>
//Se não tiver nada faça. Neste caso mostrar um campo!
<?php echo $cck->renderField('campoacao'); ?>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment