pentium10
(Hexagonhu)
January 19, 2011, 8:50am
1
I have a Terms and Condition page accessed like this: index.php/site/page?view=terms
As you see it uses a view=terms
.
I have to show this content on the registration form in a textarea. Registration is accessed as: index.php/authorize/registrationdetails
How do I get the Terms content to include on the Registration view?
zaccaria
(Matteo Falsitta)
January 19, 2011, 9:11am
2
You can use $this->renderPartial(‘terms’)
foe_1
(foe#1)
January 19, 2011, 9:11am
3
$template = ‘application.views.site./terms’;
$html = $this->renderPartial($template, array(), true, false);
The $html contains the HTML code that you can render inside your textarea
pentium10
(Hexagonhu)
January 19, 2011, 9:16am
4
None of the methods work:
I get
for 1st:
AuthorizeController cannot find the requested view "terms".
for 2nd:
AuthorizeController cannot find the requested view "application.views.site./terms".
(as said earlier the terms is a view in the site controller)
foe_1
(foe#1)
January 19, 2011, 9:19am
5
Pentium10:
None of the methods work:
I get
for 1st:
AuthorizeController cannot find the requested view "terms".
for 2nd:
AuthorizeController cannot find the requested view "application.views.site./terms".
(as said earlier the terms is a view in the site controller)
Check if the path to your terms view page is correct. I just used a sample path.
pentium10
(Hexagonhu)
January 19, 2011, 9:21am
6
How do I figure out that?
I have this working url: index.php/site/page?view=terms
zaccaria
(Matteo Falsitta)
January 19, 2011, 9:22am
7
Is not a good practice to use views of another controller.
If you have some content that you have to display more than once, create a widget.
About the second method, there is a typo, the slash is not needed.
You have to understand that code that people post in the forum can be affected by typos or mistake. Before posting agint try to do some debug or to read the documentation of the method renderPartial, all answer are here.
Pay attention that have a fame of user "fast on the button - " can prevent many user to post for help you in future.
pentium10
(Hexagonhu)
January 19, 2011, 9:24am
8
Thanks, I figured out, views are in pages.
Correct:
$template = ‘application.views.site.pages.terms’;
foe_1
(foe#1)
January 19, 2011, 9:28am
9
Pentium10:
Thanks, I figured out, views are in pages.
Correct:
$template = ‘application.views.site.pages.terms’;
Sorry about my fat finger. As suggested Widget is a better solution.