Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Parsing a value with setRedirect() 11 Apr 2012 06:53 #1971

In a controller 'property' i have a savebooking option. In that controller i save several records, also one record in the table booking. After saving the record i redirect to a thankyou layout of the booking table.
$vars = array();
	   JRequest::setVar( 'view'  , 'bookingitem');
           JRequest::setVar( 'layout', 'bookingthankyou' );
           JRequest::setVar( 'cid', $model_bookingitem->_id );

           $this->setRedirect(Mw1bookingHelper::urlRequest($vars));

In the cid i parse the id of the new bookingitem record with $model_bookingitem->_id. The url is then like bookingitem/bookingthankyou?lang=&cid[0]=96

What i do not want is the cid[0]=96 part. How can i parse a variable with the $model_bookingitem->_id without showing this variable in the url, the url would then be: bookingitem/bookingthankyou?lang=

Is this possible? If yes, how to?
Molenwal1 Webdesign
www.molenwal1.nl

Please Log in or Create an account to join the conversation.

Re: Parsing a value with setRedirect() 18 Apr 2012 08:19 #2047

Maybe someone can explain me how i am able to change the url to a SEO url, for example it is now:
www.zomerhuisjebythesea.nl/bezetting-res...king/subpropertyitem

www.zomerhuisjebythesea.nl => the domain name
bezetting-reserveren => menu title
1 => id of the subpropertyitem
subpropertybooking => layout (of j-cook component)
subpropertyitem => view (of j-cook component)

I would love to sea something like:
www.zomerhuisjebythesea.nl/bezetting-reserveren/<br> <br> <Title of the subpropertyitem> is a field title in the table subproperty.<br> <br> Is that possible? Is there any documentation about this? </div> </div> <div class="kmsgsignature"> <div>Molenwal1 Webdesign<br> <a class="bbcode_url" href="http://www.molenwal1.nl" target="_blank" rel="nofollow noopener noreferrer">www.molenwal1.nl</a></div> </div> </td> </tr> <tr> <td class="kbuttonbar-left"> <p>Please <a class="btn-link" href="/index.php/profile?view=login&return=aHR0cHM6Ly9qLWNvb2sucHJvL2luZGV4LnBocC9mb3J1bS85LWNvZGluZy1pbnNpZGUteW91ci1jb21wb25lbnQvMTk3MS1wYXJzaW5nLWEtdmFsdWUtd2l0aC1zZXRyZWRpcmVjdA==" rel="nofollow">Log in</a> or <a class="btn-link" href="/index.php/profile?view=registration">Create an account</a> to join the conversation.</p><div class="kmessage-editmarkup-cover hidden-phone"> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> </div> </div> </td> </tr> </tbody> </table> </div> </div> <div class="kcontainer"> <div class="kbody"> <div class="kmsg-header kmsg-header-left"> <h2> <span class="kmsgtitle kmsg-title-left"> Re: Parsing a value with setRedirect() </span> <span class="kmsgdate kmsgdate-left" title="12 years 9 months ago"> 19 Apr 2012 06:37 </span> <span class="kmsg-id-left"> <a href="#2051" id="2051" rel="canonical">#2051</a> </span> </h2> </div> <table class="kmsg kpublished"> <tbody> <tr> <td class="kprofile-left" rowspan="2"> <ul class="kpost-profile"> <li class="kpost-username"> <strong><a class="kwho-user hasTooltip" href="/index.php/forum/user/855-etc" title="View etc's Profile" rel="canonical">etc</a></strong> </li> <li> <a class="kwho-user hasTooltip" href="/index.php/forum/user/855-etc" title="View etc's Profile" ><img class="img-circle" src="https://j-cook.pro/media/kunena/avatars/resized/size144/users/avatar855.JPG" width="144" height="144" alt="etc's Avatar" /></a> <!-- <span class=" topic-moderator"></span> --> </li> <li> <a href="/index.php/forum/user/855-etc" data-toggle="tooltip" title="" class="label label-default "> Offline</a> </li> <li> Premium Member </li> <li> <img src="/media/kunena/ranks/rank4.gif" height="16" width="70" alt="Premium Member" /> </li> <li> Posts: 132 </li> <li> Thank you received: 19 </li> <li> <span class="kicon-profile kicon-profile-gender-male" data-toggle="tooltip" data-placement="right" title="Gender: Male"></span> </li> <li> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Czech Republic"><span class="kicon-profile kicon-profile-location" aria-hidden="true"></span></span> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Click here to send a private message to this user." ></span> </li> </ul> </td> <td class="kmessage-left"> <div class="kmsgbody"> <div class="kmsgtext"> It looks you are talking about settings in Joomla admin->Global Configuration->SEO Settings </div> </div> </td> </tr> <tr> <td class="kbuttonbar-left"> <p>Please <a class="btn-link" href="/index.php/profile?view=login&return=aHR0cHM6Ly9qLWNvb2sucHJvL2luZGV4LnBocC9mb3J1bS85LWNvZGluZy1pbnNpZGUteW91ci1jb21wb25lbnQvMTk3MS1wYXJzaW5nLWEtdmFsdWUtd2l0aC1zZXRyZWRpcmVjdA==" rel="nofollow">Log in</a> or <a class="btn-link" href="/index.php/profile?view=registration">Create an account</a> to join the conversation.</p><div class="kmessage-editmarkup-cover hidden-phone"> <span class="kmessage-editmarkup hidden-phone"> Last edit: by <a class="kwho-user hasTooltip" href="/index.php/forum/user/855-etc" title="View etc's Profile" rel="nofollow">etc</a>. </span> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> </div> </div> </td> </tr> </tbody> </table> </div> </div> <div class="kcontainer"> <div class="kbody"> <div class="kmsg-header kmsg-header-left"> <h2> <span class="kmsgtitle kmsg-title-left"> Re: Parsing a value with setRedirect() </span> <span class="kmsgdate kmsgdate-left" title="12 years 9 months ago"> 19 Apr 2012 08:23 </span> <span class="kmsg-id-left"> <a href="#2053" id="2053" rel="canonical">#2053</a> </span> </h2> </div> <table class="kmsg kpublished"> <tbody> <tr> <td class="kprofile-left" rowspan="2"> <ul class="kpost-profile"> <li class="kpost-username"> <strong><a class="kwho-user hasTooltip" href="/index.php/forum/user/1007-molenwal1" title="View molenwal1's Profile" rel="canonical">molenwal1</a></strong> </li> <li> <a class="kwho-user hasTooltip" href="/index.php/forum/user/1007-molenwal1" title="View molenwal1's Profile" ><img class="img-circle" src="https://j-cook.pro/media/kunena/avatars/resized/size144/users/avatar1007.jpg" width="144" height="144" alt="molenwal1's Avatar" /></a> <span class="hidden-phone topic-starter topic-starter-circle">Topic Author</span> <!-- <span class=" topic-moderator"></span> --> </li> <li> <a href="/index.php/forum/user/1007-molenwal1" data-toggle="tooltip" title="" class="label label-default "> Offline</a> </li> <li> Senior Member </li> <li> <img src="/media/kunena/ranks/rank3.gif" height="16" width="70" alt="Senior Member" /> </li> <li> Posts: 63 </li> <li> Thank you received: 17 </li> <li> <span class="kicon-profile kicon-profile-gender-male" data-toggle="tooltip" data-placement="right" title="Gender: Male"></span> </li> <li> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Westkapelle, The Netherlands"><span class="kicon-profile kicon-profile-location" aria-hidden="true"></span></span> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Click here to send a private message to this user." ></span> </li> </ul> </td> <td class="kmessage-left"> <div class="kmsgbody"> <div class="kmsgtext"> No, everything is set correctly for SEO . I am also using AceSEF of JoomAce.<br> <br> In AceSEF i have set to use the component router for my component. I think it is a combination of AceSEF and SEO. I will look further into this. </div> </div> <div class="kmsgsignature"> <div>Molenwal1 Webdesign<br> <a class="bbcode_url" href="http://www.molenwal1.nl" target="_blank" rel="nofollow noopener noreferrer">www.molenwal1.nl</a></div> </div> </td> </tr> <tr> <td class="kbuttonbar-left"> <p>Please <a class="btn-link" href="/index.php/profile?view=login&return=aHR0cHM6Ly9qLWNvb2sucHJvL2luZGV4LnBocC9mb3J1bS85LWNvZGluZy1pbnNpZGUteW91ci1jb21wb25lbnQvMTk3MS1wYXJzaW5nLWEtdmFsdWUtd2l0aC1zZXRyZWRpcmVjdA==" rel="nofollow">Log in</a> or <a class="btn-link" href="/index.php/profile?view=registration">Create an account</a> to join the conversation.</p><div class="kmessage-editmarkup-cover hidden-phone"> <span class="kmessage-editmarkup hidden-phone"> Last edit: by <a class="kwho-user hasTooltip" href="/index.php/forum/user/1007-molenwal1" title="View molenwal1's Profile" rel="nofollow">molenwal1</a>. </span> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> </div> </div> </td> </tr> </tbody> </table> </div> </div> <div class="kcontainer"> <div class="kbody"> <div class="kmsg-header kmsg-header-left"> <h2> <span class="kmsgtitle kmsg-title-left"> Re: Parsing a value with setRedirect() </span> <span class="kmsgdate kmsgdate-left" title="12 years 9 months ago"> 19 Apr 2012 08:47 </span> <span class="kmsg-id-left"> <a href="#2055" id="2055" rel="canonical">#2055</a> </span> </h2> </div> <table class="kmsg kpublished"> <tbody> <tr> <td class="kprofile-left" rowspan="2"> <ul class="kpost-profile"> <li class="kpost-username"> <strong><a class="kwho-admin hasTooltip" href="/index.php/forum/user/62-admin" title="View admin's Profile" rel="canonical">admin</a></strong> </li> <li> <a class="kwho-admin hasTooltip" href="/index.php/forum/user/62-admin" title="View admin's Profile" ><img class="img-circle" src="https://j-cook.pro/media/kunena/avatars/resized/size144/users/avatar62.jpg" width="144" height="144" alt="admin's Avatar" /></a> <!-- <span class=" topic-moderator"></span> --> </li> <li> <a href="/index.php/forum/user/62-admin" data-toggle="tooltip" title="" class="label label-default "> Offline</a> </li> <li> Administrator </li> <li> <img src="/media/kunena/ranks/rankadmin.gif" height="16" width="70" alt="Administrator" /> </li> <li> Chef </li> <li> Posts: 3711 </li> <li> Thank you received: 986 </li> <li> <span class="kicon-profile kicon-profile-gender-male" data-toggle="tooltip" data-placement="right" title="Gender: Male"></span> </li> <li> </li> <li> <span data-toggle="tooltip" data-placement="right" title="France"><span class="kicon-profile kicon-profile-location" aria-hidden="true"></span></span> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Click here to send a private message to this user." ></span> </li> </ul> </td> <td class="kmessage-left"> <div class="kmsgbody"> <div class="kmsgtext"> To handle special vars of your specific extension, you have to make the changes in the router.php file of your component (front).<br> <br> xxxxBuildRoute(&$query) : Encode URL<br> xxxxParseRoute($segments) : Decode URL </div> </div> <div class="kmsgsignature"> <div><span style="font-size:1.2em">Coding is now a <b>piece of cake</b></span> </div> </div> </td> </tr> <tr> <td class="kbuttonbar-left"> <p>Please <a class="btn-link" href="/index.php/profile?view=login&return=aHR0cHM6Ly9qLWNvb2sucHJvL2luZGV4LnBocC9mb3J1bS85LWNvZGluZy1pbnNpZGUteW91ci1jb21wb25lbnQvMTk3MS1wYXJzaW5nLWEtdmFsdWUtd2l0aC1zZXRyZWRpcmVjdA==" rel="nofollow">Log in</a> or <a class="btn-link" href="/index.php/profile?view=registration">Create an account</a> to join the conversation.</p><div class="kmessage-editmarkup-cover hidden-phone"> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> </div> </div> </td> </tr> </tbody> </table> </div> </div> <div class="kcontainer"> <div class="kbody"> <div class="kmsg-header kmsg-header-left"> <h2> <span class="kmsgtitle kmsg-title-left"> Re: Parsing a value with setRedirect() </span> <span class="kmsgdate kmsgdate-left" title="12 years 8 months ago"> 04 May 2012 05:28 </span> <span class="kmsg-id-left"> <a href="#2230" id="2230" rel="canonical">#2230</a> </span> </h2> </div> <table class="kmsg kpublished"> <tbody> <tr> <td class="kprofile-left" rowspan="2"> <ul class="kpost-profile"> <li class="kpost-username"> <strong><a class="kwho-user hasTooltip" href="/index.php/forum/user/855-etc" title="View etc's Profile" rel="canonical">etc</a></strong> </li> <li> <a class="kwho-user hasTooltip" href="/index.php/forum/user/855-etc" title="View etc's Profile" ><img class="img-circle" src="https://j-cook.pro/media/kunena/avatars/resized/size144/users/avatar855.JPG" width="144" height="144" alt="etc's Avatar" /></a> <!-- <span class=" topic-moderator"></span> --> </li> <li> <a href="/index.php/forum/user/855-etc" data-toggle="tooltip" title="" class="label label-default "> Offline</a> </li> <li> Premium Member </li> <li> <img src="/media/kunena/ranks/rank4.gif" height="16" width="70" alt="Premium Member" /> </li> <li> Posts: 132 </li> <li> Thank you received: 19 </li> <li> <span class="kicon-profile kicon-profile-gender-male" data-toggle="tooltip" data-placement="right" title="Gender: Male"></span> </li> <li> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Czech Republic"><span class="kicon-profile kicon-profile-location" aria-hidden="true"></span></span> </li> <li> <span data-toggle="tooltip" data-placement="right" title="Click here to send a private message to this user." ></span> </li> </ul> </td> <td class="kmessage-left"> <div class="kmsgbody"> <div class="kmsgtext"> Maybe it is same issue.<br> Anyway, I have own form that only posts "datefrom" and "dateto" variables from calendar, this works well.<br> When I turn on SEO I can not retrieve date variable from POST.<br> <br> So I registred date variable in heper(admin site)<br> <div class="highlight"><pre>$authorizedInUrl = array('option', 'view', 'layout', 'Itemid', 'tmpl', 'datefrom', 'dateto')</pre></div><br> It helped and it works again but SEO URL is not completely nice, actualy that part I added.<br> I would like to hide the datefrom and dateto variables in URL.<br> <a class="bbcode_url" href="http://www.something.com/something/something/something/default?datefrom=2012-04-16&dateto=2012-05-04" target="_blank" rel="nofollow noopener noreferrer">www.something.com/something/something/so...16&dateto=2012-05-04</a><br> <br> What are the next steps to achieve that?<br> router.php<br> maybe in tmpl/some layout<br> .<br> .<br> <br> I believe this is possible to hide it but I still do not know how.<br> Any idea?<br> <br> thanks </div> </div> <div class="kmessage-thankyou"> The following user(s) said Thank You: <a class="kwho-admin hasTooltip" href="/index.php/forum/user/62-admin" title="View admin's Profile" rel="nofollow">admin</a> </div> </td> </tr> <tr> <td class="kbuttonbar-left"> <p>Please <a class="btn-link" href="/index.php/profile?view=login&return=aHR0cHM6Ly9qLWNvb2sucHJvL2luZGV4LnBocC9mb3J1bS85LWNvZGluZy1pbnNpZGUteW91ci1jb21wb25lbnQvMTk3MS1wYXJzaW5nLWEtdmFsdWUtd2l0aC1zZXRyZWRpcmVjdA==" rel="nofollow">Log in</a> or <a class="btn-link" href="/index.php/profile?view=registration">Create an account</a> to join the conversation.</p><div class="kmessage-editmarkup-cover hidden-phone"> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> <div class="ktopactions"> <table id="topic-actions"> <tbody> <tr> <td class="klist-actions-goto center"> <a id="forumbottom"> </a> <a href="#forumtop"> <span class="kicon kforumbottom"></span> </a></td> <td class="klist-actions-forum"> <div class="kmessage-buttons-row"> </div> <div class="kmessage-buttons-row"> </div> </td> <td class="klist-pages-all"> <ul class="kpagination"> <li class="page">Page:</li><li><span class="pagenav">1</span></li></ul> </td> </tr> </tbody> </table> </div> <div class="pull-right"></div> <div class="clearfix"></div> <div class="kblock kpathway breadcrumbs-2"> <div class="kcontainer"> <div class="ksectionbody"> <div class="kforum-pathway"> <div class="path-element-first"><a href="/index.php/forum">Forum</a> </div> <div class="path-element"><a href="/index.php/forum/4-support-forum">Support forum</a> </div> <div class="path-element"><a href="/index.php/forum/9-coding-inside-your-component">Coding inside your component</a> </div> <div class="path-element"><a href="/index.php/forum/9-coding-inside-your-component/1971-parsing-a-value-with-setredirect">Parsing a value with setRedirect()</a> </div> </div> </div> </div> </div> <div class="pull-right large-kicon"><a rel="alternate" type="application/rss+xml" href="/index.php/forum1/topics/default/mode-topics?format=feed&type=rss"><i class="icon icon-feed hasTooltip" title="Get the latest posts directly to your desktop" aria-hidden="true"></i></a></div> <div class="clearfix"></div> <div class="center"> Time to create page: 0.069 seconds </div> </div> <div style="text-align:center;"><a href="/index.php/forum/credits" style="display: inline !important; visibility: visible !important; text-decoration: none !important;">Powered by</a> <a href="https://www.kunena.org" target="_blank" rel="noopener noreferrer" style="display: inline !important; visibility: visible !important; text-decoration: none !important;">Kunena Forum</a></div> </div> </div> </div> </td> </tr> </table> <div id="bottom"> <div class="akmarkdown-content" ><div class="quotes" style="margin-top: 50px; margin-bottom: 50px;"> <div class="quote-open pull-left">“</div> <div class="quote-close pull-right">”</div> <p> <span class="quote-review"> I want to save the world...... let's cook a solution about it. </span><br /><span class="review-author"> VeCrea (Forum) </span></p></div> <div style="height:100px"></div> </div> </div> </div> </div> <div id="get-started"> <div style="text-align: right;"> <h1>Get Started</h1> <div class="btn-group"><a class="btn btn-large btn-success" href="/index.php/profile?view=login">Log In</a> <a class="btn btn-large btn-warning" href="/index.php/profile?view=registration">Sign In</a></div> </div> </div> <div id="scissors-footer"></div> <div id="footer-wrap" class="clr" > <div id="footer"> <div id="footer-hz"> <ul class="menu "> <li class="item-101"><a href="/index.php" ><span class="menutitle">Home</span> <span class="menudesc"></span></a></li><li class="item-717"><a href="/index.php/builder" ><span class="menutitle">Builder</span> <span class="menudesc"></span></a></li><li class="item-718 current active"><a href="/index.php/forum" ><span class="menutitle">Forum</span> <span class="menudesc"></span></a></li><li class="item-719"><a href="/index.php/docs/feature-requests" ><span class="menutitle">Feature Requests</span> <span class="menudesc"></span></a></li><li class="item-667"><a href="/index.php/affiliate" ><span class="menutitle">Affiliate program</span> <span class="menudesc"></span></a></li><li class="item-428"><a href="/index.php/feedback" ><span class="menutitle">Feedbacks</span> <span class="menudesc"></span></a></li><li class="item-479"><a href="/index.php/contact" ><span class="menutitle">Contact</span> <span class="menudesc"></span></a></li></ul> </div> <div id="footer-left" class=""> <div class="cook-footer-logo"> <div class="footer-logo-wrap"> <a title="Home" href="/index.php"> <img alt="Cook Self Service"> </a> </div> </div> </div> <div id="footer-right" class=""> <div class="footer-lightning"></div> <div id="copyright"> Copyright © 2016 - <a href="http://www.j-cook.pro/">Cook Self Service</a> </div> </div> <div id="footer-center" class="row-fluid" style=""> <div id="footer-1" class="span4"> <div class="module acymailing blank"> <div class="inner"> <h3 class="module-title">Newsletter</h3><span class="modtitle"></span> <div class="module-body"> <div class="acymailing_module acymailing blank" id="acymailing_module_formAcymailing87651"> <div class="acymailing_fulldiv" id="acymailing_fulldiv_formAcymailing87651" > <form id="formAcymailing87651" action="/index.php/forum" onsubmit="return submitacymailingform('optin','formAcymailing87651')" method="post" name="formAcymailing87651" > <div class="acymailing_module_form" > <div class="acymailing_form"> <p class="onefield fieldacyname" id="field_name_formAcymailing87651"> <span class="acyfield_name acy_requiredField"><input id="user_name_formAcymailing87651" onfocus="if(this.value == 'Name') this.value = '';" onblur="if(this.value=='') this.value='Name';" class="inputbox" type="text" name="user[name]" style="width:80%" value="Name" title="Name"/></span> </p><p class="onefield fieldacyemail" id="field_email_formAcymailing87651"> <span class="acyfield_email acy_requiredField"><input id="user_email_formAcymailing87651" onfocus="if(this.value == 'E-mail') this.value = '';" onblur="if(this.value=='') this.value='E-mail';" class="inputbox" type="text" name="user[email]" style="width:80%" value="E-mail" title="E-mail" /></span> </p> <p class="acysubbuttons"> <input class="button subbutton btn btn-primary" type="submit" value="Subscribe" name="Submit" onclick="try{ return submitacymailingform('optin','formAcymailing87651'); }catch(err){alert('The form could not be submitted '+err);return false;}"/> </p> </div> <input type="hidden" name="ajax" value="0"/> <input type="hidden" name="acy_source" value="module_132" /> <input type="hidden" name="ctrl" value="sub"/> <input type="hidden" name="task" value="notask"/> <input type="hidden" name="redirect" value="https%3A%2F%2Fj-cook.pro%2Findex.php%2Fforum%2F9-coding-inside-your-component%2F1971-parsing-a-value-with-setredirect"/> <input type="hidden" name="redirectunsub" value="https%3A%2F%2Fj-cook.pro%2Findex.php%2Fforum%2F9-coding-inside-your-component%2F1971-parsing-a-value-with-setredirect"/> <input type="hidden" name="option" value="com_acymailing"/> <input type="hidden" name="hiddenlists" value="2,1"/> <input type="hidden" name="acyformname" value="formAcymailing87651" /> </div> </form> </div> </div> </div> </div> </div> </div> <div id="footer-2" class="span4"> <div class="module "> <div class="inner"> <div class="module-body"> <ul class="menu blank"> <li class="item-476"><a href="/index.php/terms-of-service" ><span class="menutitle">Terms of service</span> <span class="menudesc"></span></a></li><li class="item-475"><a href="/index.php/privacy-policy" ><span class="menutitle">Privacy Policy</span> <span class="menudesc"></span></a></li><li class="item-473"><a href="/index.php/general-sales-conditions" ><span class="menutitle">General Sales Conditions</span> <span class="menudesc"></span></a></li><li class="item-474"><a href="/index.php/legal-notice" ><span class="menutitle">Legal notice</span> <span class="menudesc"></span></a></li><li class="item-518"><a href="/index.php/license" ><span class="menutitle">License</span> <span class="menudesc"></span></a></li></ul> </div> </div> </div> </div> <div id="footer-3" class="span4"> </div> </div </div> </div> </div> </div> </body> </html>