Last active
March 26, 2018 08:55
-
-
Save lots0logs/e027e6c903514838b73eec21861d723a to your computer and use it in GitHub Desktop.
Module Setting Default Value Example 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SimpleHeader extends Component { | |
| // Example 1: Text orientation has been set to the non-default value 'right' | |
| render() { | |
| console.log(this.props.text_orientation); // Outputs: 'right' | |
| } | |
| // Example 2: Text orientation has been set to the default value 'left' | |
| render() { | |
| console.log(this.props.text_orientation); // Outputs: '' | |
| } | |
| // Example 3: Text orientation setting definition included the 'default_on_front' parameter set to 'true' | |
| // Text orientation has been set to the default value 'left' | |
| render() { | |
| console.log(this.props.text_orientation); // Outputs: 'left' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class SIMP_SimpleHeader extends ET_Builder_Module { | |
| // Example 1: Text orientation has been set to the non-default value 'right' | |
| public function render( $unprocessed_props, $content = null, $render_slug ) { | |
| echo $this->props['text_orientation']; // Outputs: 'right' | |
| } | |
| // Example 2: Text orientation has been set to the default value 'left' | |
| public function render( $unprocessed_props, $content = null, $render_slug ) { | |
| echo $this->props['text_orientation']; // Outputs: '' | |
| } | |
| // Example 3: Text orientation setting definition included the 'default_on_front' parameter set to 'true' | |
| // Text orientation has been set to the default value 'left' | |
| public function render( $unprocessed_props, $content = null, $render_slug ) { | |
| echo $this->props['text_orientation']; // Outputs 'left' | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment