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
| <!-- In some controller, etc somewhere --> | |
| <?php | |
| // Say you find yourself with a big array of data | |
| $messageList = $email->getCompetitionMessages($competition); | |
| // but you want to filter out anything from the admin | |
| $messageList = array_filter($messageList,new Istart_Filter_ValueInObjectArrayFilter('fromEmail','admin@example.com')); | |
| // Or, if < PHP 5.3 |
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
| dojo.query('#teamMemberInvitesList input[type=checkbox]').forEach( | |
| function(node){ | |
| var checkbox = dijit.getEnclosingWidget(node); | |
| if(checkbox){ | |
| checkbox.attr('checked',false); | |
| } | |
| } | |
| ); |
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 | |
| /* In your controller action */ | |
| class search extends Zend_Controller{ | |
| public function searchResultsAction() | |
| { | |
| $request = $this->getRequest(); | |
| $sort = $request->getParam('sort','date'); | |
| $this->view->sort = $sort; | |
| $pageSize = (int) $request->getParam('pagesize',10); |
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 | |
| $color = new Zend_Form_Element_Text('color'); | |
| $color->AddValidator('Regex',false,array('/^\#[a-f0-9]{6}$/i')); | |
| $color->getValidator('Regex')->setMessages( array( | |
| Zend_Validate_Regex::NOT_MATCH => | |
| '\'%value%\' is not valid. Use a value in the form of #112233' | |
| )); |
NewerOlder