Beispiel #1
0
/**
 * Builds a HTML input[type="submit"] tag
 *
 *<code>
 * echo Phalcon\Tag::submitButton("Save")
 *</code>
 *
 * Volt syntax:
 *<code>
 * {{ submit_button('Save') }}
 *</code>
 *
 * @param array $parameters
 * @return string
 */
PHP_METHOD(Phalcon_Tag, submitButton){

	zval *parameters, *name, *as_value, *html;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &parameters);
	
	PHALCON_INIT_VAR(name);
	ZVAL_STRING(name, "submit", 1);
	
	PHALCON_INIT_VAR(as_value);
	ZVAL_BOOL(as_value, 1);
	
	PHALCON_INIT_VAR(html);
	PHALCON_CALL_SELF_PARAMS_3(html, this_ptr, "_inputfield", name, parameters, as_value);
	RETURN_CCTOR(html);
}
Beispiel #2
0
/**
 * Builds a HTML input[type="submit"] tag
 *
 *<code>
 * echo Phalcon\Tag::submitButton("Save")
 *</code>
 *
 * @param array $params
 * @return string
 */
PHP_METHOD(Phalcon_Tag, submitButton){

	zval *parameters, *name, *as_value, *html;

	PHALCON_MM_GROW();

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &parameters) == FAILURE) {
		PHALCON_MM_RESTORE();
		RETURN_NULL();
	}

	PHALCON_INIT_VAR(name);
	ZVAL_STRING(name, "submit", 1);
	
	PHALCON_INIT_VAR(as_value);
	ZVAL_BOOL(as_value, 1);
	
	PHALCON_INIT_VAR(html);
	PHALCON_CALL_SELF_PARAMS_3(html, this_ptr, "_inputfield", name, parameters, as_value);
	
	RETURN_CCTOR(html);
}