// Create new Smarty object with custom options $options = array( 'template_dir' => 'templates/', 'compile_dir' => 'templates_c/', 'cache_dir' => 'cache/', ); $smarty = new Smarty($options);In this example, we create a new Smarty object and pass an array of configuration options to the constructor. The template_dir option specifies the directory where Smarty will look for template files, compile_dir specifies the directory for compiled template files, and cache_dir specifies the directory for cached template output. Package Library: The example code uses the Smarty package library. Smarty is a PHP template engine that separates application logic from presentation. It provides a simple and elegant syntax for creating templates and supports a range of features such as caching, template inheritance, and plugins.