Yii how to redirect to hash link form controller? - redirect

I'm working on YII framework. I've code form where I've to redirect to the page and in the page I've a grid view. I want to redirect to that hash link which will directly to take them to the grid. Because actually the changes are made to the grid.
$this->redirect(array('user/view','id'=>$mIntUserId));
How can I add a hash link to the existing URL #userList.

From yii documentation
Tip: In order to generate URL with a hashtag, for example
/index.php?r=post/read&id=100#title, you need to specify parameter
named # using
$this->createUrl('post/read',array('id'=>100,'#'=>'title')).
So in your case
$this->redirect(array('user/view','id'=>$mIntUserId,'#'=>'userList'));

Related

Store TYPO3 fluid request variables (i.e. searchform) for bookmarks

What's the best practice to be able to store fluid form variables as a bookmark (for simple search filter storing)?
We have a simple extbase&fluid plugin that shows searchfilters and searchresults. The filters are a collection of input and select fields, all created with . Fluid puts in a lot of extra parameters with _referred information and chash's into the request.
Now we want a visitor to be able to bookmark a search result easily. If we use a HTTP GET request, the URL sadly exceeds the URL variable limit because of all the extra parameters; and without them, the fluid plugin won't take on the arguments (unless we disable caching of the whole page?).
The best way (imo) is to generate a clean url that can be stored. In Fluid you can add a link with only the parameters you need and add an onclick event with JS to add this link as a bookmark.
<f:link.action action="yourAction" controller="yourController" arguments="{filterArguments}">Add Bookmark</f:link.action>
How to add the bookmark function with js(jQuery):
How do I add an "Add to Favorites" button or link on my website?
It is also a good practice to configure realurl to produce nice urls for your extension

Joomla Contact Form (from the ground up)

I'm looking to create a customized contact form in a Joomla 3 site I have created. I know how to write the php code for the form, but I'm unsure of where to place the code.
Ok, the form is located at http://www.theoscorner.com/contact-us. What you see there is only the design, and there is currently no script for the form to submit to. If I wanted to create a new php page for the form to submit to, what is the best method of doing this? For example:
Should I create a completely new php file where the template's index.php file sits, and use a module (instead of an article) to hold the form.
Should I create a new article page, and place my php script in that article?
Should I hard-code my form into a module, and place a php function at the end of the index.php page which gets called when the page is refreshed and the POST values are set.
I'm just looking for any type of guidance I can get right now. I don't want to use a third-party plugin, because I want a little more control than they allow. Thank you for your time.
Just use RS Forms or Contact Enhanced, they are both Joomla extensions available on extensions.joomla.org
There is no need to create your own MVC component.

textarea and jsp

I have a textarea that I first print some values coming from a request.getParameter("some_textarea_name"). The user is allowed to modify those values and then I want to get the new values and replace the old ones with the new ones so as to query the new ones and get the results from my database tables. Can I do that without redirecting the user to a new page e.g without using the <form method> and the request.getParameter()
Can I do that without redirecting the user
Yes, you can implement an ajax call that will submit the form without redirecting the user and you can do something with the response (perhaps add it to the page).
If you need help using ajax follow this tutorial, but be aware that it implements AJAX in pure javascript (its a bit more bloated / complicated). If you want to keep it simple look into jQuery ajax, and here is a tutorial too.
without using the
No, you need to use the form to be submitted, however if you use ajax you wont need to redirect the user.

Standalone Wordpress form does not post to specified action when fields are populated

So this is weird....
I have a form I've created myself (not a plugin, this is what I mean by standalone), and for some strange reason it does not post to the form's action when the form fields have data in them. However, when the fields are empty it successfully posts to the other page.
I have turned off all validators and really am not sure why this is happening.
Do I need to hook into a Wordpress function to allow for my own form submission?
I realized my permalink structure is /%category%/%postname%/ so perhaps it cannot properly post to the URL since it's not an actual file.
How can I achieve this?
Thanks
Wordpress uses query vars to route the request to posts/pages etc. My guess is that one/some of your field names are used by Wordpress internally.
Check http://codex.wordpress.org/WordPress_Query_Vars for the list of vars you shouldn't use

Codeigniter from and uri

OK i have this problem:
I'm creating a search function and to do that correctly i have to pass the word that is written in search field to uri eg. third segment. But since Codeigniter only supports post and not get method (it can be enabled but I'm looking for way around) I need to pass that variable via post to uri. Can anybody help me?
POST to a controller then redirect to the page with the word in the URL.
search.php
$this->input->post('q') AND redirect('search/query/'.$this->input->post('q');
Tada.