I want to include several external php files in a cakephp View
require_once and require methods
I can use require_once() and require() to get one of the php files to show in the View. However, the rest of the 'require_once' php files do not show eg. THe page renders but only the first require_once / require shows in View.
Question: is there a limit to number of require_once's on a cakephp page?
App::import('Vendor', 'phpfilename') method
As an alternative I have tried to get App::import('Vendor', 'phpfilename') to work with no success.
I have put the php files i wnat to include in the View into the Vendor folder.
Its not 100% clear to me from documentation, or various posts on App::import .. where the 'App::import' part goes.
I have put <?php App::import('vendor', 'phpfilename'); ?> in the View where i want to page to be included but doesn't work eg stops the page from rendering at that point.
I suspect there is more to it but again not clear.
I am aware that the more advanced options of either a) building plugin or perhaps b) using helper, exist, but i am not up to that task.
So any advice on how to include the external files in View are warmly welcomed!!
-- require_once and require methods
I can use require_once() and require() to get one of the php files to show in the View. However, the rest of the 'require_once' php files do not show eg. THe page renders but only the first require_once / require shows in View.
Question: is there a limit to number of require_once's on a cakephp page?
App::import('Vendor', 'phpfilename') method
As an alternative I have tried to get App::import('Vendor', 'phpfilename') to work with no success.
I have put the php files i wnat to include in the View into the Vendor folder.
Its not 100% clear to me from documentation, or various posts on App::import .. where the 'App::import' part goes.
I have put <?php App::import('vendor', 'phpfilename'); ?> in the View where i want to page to be included but doesn't work eg stops the page from rendering at that point.
I suspect there is more to it but again not clear.
I am aware that the more advanced options of either a) building plugin or perhaps b) using helper, exist, but i am not up to that task.
So any advice on how to include the external files in View are warmly welcomed!!
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment