Created
          June 3, 2014 09:19 
        
      - 
      
- 
        Save tristanlins/fd934e5f6f7ad1d0e42e to your computer and use it in GitHub Desktop. 
  
    
      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 | |
| $GLOBALS['TL_DCA']['tl_content']['fields']['my_headline']['save_callback'][] = array('Hooks', 'saveMyHeadline'); | |
| class Hooks | |
| { | |
| public function saveMyHeadline($value, $dc) | |
| { | |
| $headline = array('value' => $value, 'unit' => 'h2'); | |
| $database = \Database::getInstance(); | |
| $database | |
| ->prepare('UPDATE tl_content SET headline=? WHERE id=?') | |
| ->execute($headline, $dc->id); | |
| return $value; | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment