Custom tags for my very small cms (Codeigniter)
I'm developing a very small cms kind of thing. So far I have a page controller that lets you add pages. And there is a frontend controller. All calls are received by the frontend controller and respective page is displayed. Now I want to allow some custom tags while creating a page. I am using CKEditor and I want that while creating a page user gives a tag like <!--cmsform_printform-->
and this tag will print printform method of cmsform controller.
For this I have created a controller cmsform that has a method printform. In my fronend controller I have created a method replace_tags that searches tags and then call respective controller and method.
But now I realized that my 开发者_开发问答logic was false because I should not load a controller in another controller. I can't think of anyother logic. Please someone guide me or redirect me to a good codeigniter tutorial that explains this.
Thanks
Have you tried writing a helper instead? The functionality you describe sounds more like a helper method than a controller action.
CI manual in their site lists several excellent video tutorials, notably the ones published on NetTuts+. You might want to have a look, if you haven't already. Also, please do search CI forums. They contain plenty of information on pretty much any CI-related topic.
精彩评论