本文整理汇总了PHP中Zend\View\Model\JsonModel::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP JsonModel::__construct方法的具体用法?PHP JsonModel::__construct怎么用?PHP JsonModel::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\View\Model\JsonModel
的用法示例。
在下文中一共展示了JsonModel::__construct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param null $variables
* @param mixed|int $code - 0 for success
* @param string $message - General public message for client
* @param array $errors - Example - Pass the messages from input validator
* @param null $options
*/
public function __construct($variables = null, $code = 0, $message = 'OK', $errors = [], $options = null)
{
$this->setCode($code);
$this->setMessage($message);
$this->setErrors($errors);
parent::__construct($variables, $options);
}
示例2: __construct
/**
* Initialize instance
*
* @param InputFilterInterface $inputFilter
* @param string $variables
* @param string $options
*/
public function __construct(InputFilterInterface $inputFilter, $variables = null, $options = null)
{
parent::__construct($variables, $options);
$this->setVariable('isValid', $inputFilter->isValid());
$messages = $inputFilter->getMessages();
$inputs = array();
foreach ($inputFilter->getValues() as $name => $value) {
$inputs[$name] = array('value' => $value, 'messages' => array_key_exists($name, $messages) ? $messages[$name] : array());
}
$this->setVariable('inputs', $inputs);
}
示例3: __construct
/**
* Create a new model.
*
* The API response object can be passed here directly as the first
* argument.
*
* @param \Omeka\Api\Response $apiResponse API response object
* @param array|Traversable $options
*/
public function __construct($apiResponse = null, $options = null)
{
$variables = [self::API_RESPONSE_KEY => $apiResponse];
parent::__construct($variables, $options);
}
示例4: __construct
public function __construct($variables = null, $options = null)
{
parent::__construct($variables, $options);
$this->success = true;
}
示例5: __construct
/**
* @param object|null $model The model to serialize.
* @param array|\Traversable|null $options
*/
public function __construct($model = null, $options = null)
{
parent::__construct(array('model' => $model), $options);
}
示例6: __construct
/**
* @param int $errCode
* @param array|null|\Traversable $errMessage
* @param null $options
*/
public function __construct($errCode, $errMessage, $options = null)
{
$this->errCode = $errCode;
$this->errMessage = $errMessage;
parent::__construct(null, $options);
}
示例7: __construct
/**
* @param mixed $variables
* @param string $options
*/
public function __construct($variables = null, $options = null)
{
parent::__construct($variables, $options);
}