本文整理匯總了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;