protected function _handleResponse($response, $expectsArray = false) { if (!$response) { return false; } else { if (is_array($response)) { if (array_key_exists('result', $response)) { if ($response['status']) { return $response['result']; } else { // TEMP Craft::dd($response['error']); // How to properly handle errors? return null; } } else { if ($response['status']) { $output = $response['message']; } else { $output = $response['error']; } return $output; } } else { return $response; // TEMP // Craft::dd($response); // How to properly handle errors? } } }
public function renderTest() { $this->requirePostRequest(); $post = craft()->request->getPost(); Craft::dd($post); //die(var_dump($post)); $string = craft()->request->getPost('plainFormTitle'); $renderedString = $this->renderString($string, $post); //die(var_dump($renderedString)); }
/** * Dump the results of our query in array form, * before the results get populated into EntryModels. */ public function showResults() { if (!$this->dbCommand) { Craft::dd($this->criteria->find()); } Craft::dd($this->dbCommand->queryAll()); }