GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Monday, April 4, 2011

CakePHP - Creating Elements

Elements is a lightweight html component. It lies on the app\view\elements\hello.ctp
Then on the view, you can access it by
<?php echo $this->element('hello'); ?>
And you can also pass the value from the view to the element by second arguments, like this one:
<?php echo $this->element('hello',array('name'=>'Lady Gaga'));?>
Share/Bookmark

1 comment: