Hi guys,
I have a site made in procedure html/php, and I need create a system to manager news and articles, how can I integrate my actual website with the new system?
Actually, the site dont’t have any server-side system, only some complex views.
Thanks.
imehesz
(Imehesz)
August 21, 2009, 7:45pm
2
hello,
I’m not sure if this is the best solution for it, but I’d create a controller/action pair and copy the “static HTML” into the view part ie:
// OldsiteController.php
...
public function actionContact()
{
$this -> render( 'contact' );
}
...
public function actionAbout()
{
$this -> render( 'about' );
}
...
if you have more than 10 pages though …
–iM
pestaa
(Pestaa)
August 21, 2009, 7:50pm
3
This cookbook page probably fits your needs better.
Hi guys, now I understand how make this.
Thanks.
auxbuss
(Apps)
August 23, 2009, 8:03pm
5
If you want to tidy up the way the urls look, then this might help.
Hi folks,
I’m implementing this changes in my app and I have one question:
How can I share a partial for all views?
Thanks.
pestaa
(Pestaa)
August 24, 2009, 7:34pm
7
I have a bit complex box partial view stored as views/_box.php, which can be called as follows:
$this->beginContent('../_box');
...
$this->endContent();
Hope this helps.
auxbuss
(Apps)
August 24, 2009, 9:29pm
8
Egads! The docs for CContentDecorator are cyptic. After some trial and error, is the intended way to use it like this?
In a view file:
Decorate me.
<?php $this->beginContent('_decorate');
<p>Some stuff.
<p>More stuff.
$this->endContent('_decorate');
Where _decorate is another view file, say:
I am the decorator.
<?php print $content;
Is that the idea?
Hi Pestaa,
I think that in my case is diferrent, I intend to create some partials and put on a directory called share (like in rails), and call this partials when necessary in my views.
It’s possible?
Thanks.
auxbuss
(Apps)
August 24, 2009, 9:52pm
10
Seems to be possible. This worked for me within a views/message view file
<? $this->beginContent('/site/pages/about');?>
<? $this->endContent('/site/pages/about'); ?>
The docs for beginContent() appear to be incorrect, since they claim that the view script is resolved via getViewFile(), but that resolves to a path.
pestaa
(Pestaa)
August 24, 2009, 10:00pm
11
GodFather,
Yes, just put them right in views dir and call renderPartial(’…/[…]’) in your view files.
auxbuss,
Since content decorator is used as a widget, your endContent() call should omit its parameter. (It calls endWidget internally.)
beginContent() does resolve view file with getViewFile() which accepts paths as well. If I remember well.
Thanks guys,
the problem was resolved.
Thanks.