Jump to content

smarty and the mvc architecture from advanced php training

Guest ziemowit

Recommended Posts

Guest ziemowit



I wasn't sure where to post it, but I hope here's ok. I've followed killersites advanced php tutorials and ended up with a nice foundation for an mvc app. I thought I understood everything covered in that course, but I was wrong :). I wanted to add Smarty to my app, but can't instantiate a smarty object, because I fail to include the smarty class properly. As instructed on smarty website you would do this by 'require' before creating the object. However since my app has that neat set_include_path mechanism I thought I could just add smarty to it.

The way it supposed to work was - add smarty class to included paths, instantiate smarty object in the render function of controllerabstract class, and pass some parameters from child controllers action methods. The problem is, when I create the object by <<$smarty = new Smarty(); >> I get an warning message saying that the Smarty class was not found. I must do something wrong because it also says that it looked for it in the controllers folder, or perhaps in that namespace and not in sites root folder.


I hope someone who's familiar with the tutorial could help me. Maybe I should instantiate that object differently. Any hints are welcomed.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...