本文整理汇总了PHP中Library::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Library::create方法的具体用法?PHP Library::create怎么用?PHP Library::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* Send email $to with using the $template file in the
* /app/view/email/ directory otherwise you changed {@link $viewDir}
* @param $to
* @param string $template Filename of template to use
* @param string $subject Optional alternate subject that should be used
* @param array(string) $data optional additional associated array data to render in the view
* @return boolean true if mail was successfully send, otherwise false
*/
public function send($to, $template, $subject = null, $data = array())
{
// use user logged in email for reply adress
if ($this->controller->UserLogin->loggedin()) {
$this->headers->set('Reply-To', $this->controller->UserLogin->User->get('email'));
$this->headers->set('From', $this->controller->UserLogin->User->get('email'));
}
// render content
$view = Library::create('ephFrame.lib.view.View', array($this->viewDir, $template, array_merge($this->controller->data->toArray(), $data)));
$view->theme = $this->controller->theme;
// send mail and return result
return @mail($to, $subject == null ? $this->subject : $subject, $view->render(), $this->headers->implodef(RTLF, '%s: %s'));
}
示例2: dirname
<?php
/**
* This is the application main script
*
* This is were everything about the application and the ephFrame Framework
* is created. From the Request a dispatcher is initialized that creates
* a controller from the url (if matched), that will create a view after
* running the action that is requested and outputs this view as response.
*
* @package ephFrame
* @author Marcel Eichner // Ephigenia <love@ephigenia.de
* @since 03.12.2007
*/
/**
* load ephFrame
*/
require dirname(__FILE__) . '/ephFrame.php';
/**
* Create the dispatcher that creates the controller ... which will
* start the hole ephFrame MVC-Pattern.
*/
$dispatcher = Library::create('app.lib.AppDispatcher');
$dispatcher->dispatch(new HTTPRequest(true));
exit;