This file contains 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
namespace cocode; | |
class Cocode { | |
private $_sMsg; | |
public function __construct($sMsg = '') { | |
if (!empty($sMsg)) { | |
$this->setMessage($sMsg); | |
} | |
} | |
This file contains 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
// Using Zend\Select form element | |
$oSelect = new Select('someName'); | |
$oSelect->setAttribute('id', 'mySelect')->setLabel('This is a select box'); | |
$aData = array( | |
'Option 1' => 'value1', | |
'Option 2' => 'value2', | |
array('label' => 'Option 3', 'selected' => true, 'value' => 'value3') // For default selection | |
); |
This file contains 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
// Use case for StaffHandler -> fetching roles for a user | |
/* This is only valid if you're doing it | |
* in the IntechController - and ONLY if you have previously | |
* defined $this->oRegistry as | |
* $this->oRegistry = $this->getRegistry(); | |
*/ | |
$oStaffHandler = new StaffHandler($this->oRegistry->get('StaffMapper')); |
This file contains 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
/** | |
* Search methods MUST return an array with "rowCount" and "rowSet". | |
* | |
* Search methods build queries with provided params (filters) and | |
* options (display filters - page, items per page, etc. Search | |
* methods can then use the buildAndReturnMySQL method from the | |
* Database/Abstract, or they can return their own result set. The | |
* only important thing is that they always return a single array | |
* which contains "rowCount" and "rowSet" - this is very important for | |
* pagination. |
This file contains 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 | |
/** | |
* To build a search form, extend the BackendExtendedSearchForm | |
* | |
* Then, just add some more elements into it, like in the example below. | |
* When you add the elements, don't forget to render them in the view, and | |
* fetch them in the controller when the form is submitted. | |
* | |
* You can also write a form manually, but make sure you give it the class |
This file contains 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
$this->searchForm->prepare(); | |
echo $this->form()->openTag($this->searchForm); | |
echo $this->formRow($this->searchForm->get('validity')); | |
echo $this->formRow($this->searchForm->get('deleted')); | |
echo $this->formRow($this->searchForm->get('activated')); | |
echo $this->formInput($this->searchForm->get('search')); | |
echo $this->formRow($this->searchForm->get('submit')); | |
echo $this->form()->closeTag($this->searchForm); |
This file contains 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
public function listAction() | |
{ | |
$oPagination = null; | |
$oSearchForm = new \Manager\Form\ContactSearch(); | |
$oSearchForm->setAttribute('action', '/manager/contacts/list'); | |
$oSearchForm->setData($_GET); | |
$bSearchMode = false; | |
// Display the search toolbar |
This file contains 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 | |
$this->searchForm->prepare(); | |
echo $this->form()->openTag($this->searchForm); | |
echo $this->formRow($this->searchForm->get('validity')); | |
echo $this->formRow($this->searchForm->get('deleted')); | |
echo $this->formRow($this->searchForm->get('activated')); | |
echo $this->formInput($this->searchForm->get('search')); | |
echo $this->formRow($this->searchForm->get('submit')); | |
echo $this->form()->closeTag($this->searchForm); |
This file contains 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 User.php | |
* | |
* @category | |
* @package | |
* @license BSD License | |
* @version 0.01 | |
* @since 2012-09-13 |
This file contains 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
/** | |
* The Result class is the default return format of the APIs | |
* | |
* When you get a Result object (e.g. $r), the recommended way of checking | |
* whether or not it contains any values is like so: | |
*/ | |
if ($r->count()) { | |
// Do something | |
} |
OlderNewer