user850234
user850234

Reputation: 3463

How to add a cake php file in another cake php file

I am using cake php now. I have two file example1.ctp and example2.ctp. I want to include example2.ctp in example1.ctp just like how we add php page using "include". I am new to this please suggest me how to do it.

Upvotes: 0

Views: 1602

Answers (1)

chetanspeed511987
chetanspeed511987

Reputation: 2025

According to me , You have to create Elements..

CakePHP can help you repeat parts of your website that need to be reused. These reusable parts are called Elements.

<?php echo $this->element('ur elements ctp file name'); ?>

Upvotes: 5

Related Questions