I’ve been evaluating CI to determine if it can be used to replace a home grown MVC web application currently being used on our website. I see great potential for expanding the application’s functionality using CI however I’ve run into a situation that is causing great difficulty. Specifically I would like create views without making major modifications to the design layout of the site.
For simplicity consider a simple html form that already exists on the website. Now if I wished to use CI to handle all aspects of validation and processing the form submittal I would need to create a view to do so. This would entail moving the webpage containing the form to the view directory, re-establishing any references to external resources (.js, css, images, etc.) and of course implementing the necessary CI constructs to handle the form. The problem I’m facing with this approach is that it makes it exceedingly difficult to leverage the design layout of an existing website. Or for that matter if the website design changes or the application needs to be replicated elsewhere the view must be re-created.
I’ve seen several posts and strategies suggesting ways incorporate external assets into CI views by placing js, css, images, etc., in a directory outside the CI structure, then referencing these assets in a view via base_url() (or similar convention). I have yet found a way to reference html pages in a similar fashion.
Re-visiting the above simple form example using the current home grown MVC framework, I can simply reference the web page containing the form and replace the actual form elements with a parsing pseudo-variable (or array key <?php echo $my_form;?>). With this approach all I have to is make simple html edits to the reference web page replacing the form with the parsing pseudo-variable. Since the form web page remains in the directory where it was created I don’t have to move it or re-establish any asset references.
Is it possible to make external references (outside the CI directory structure) to view templates? Or is there another approach that could be used.
Thanks,
Chris