本文整理汇总了PHP中APP类的典型用法代码示例。如果您正苦于以下问题:PHP APP类的具体用法?PHP APP怎么用?PHP APP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了APP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find_customer
public function find_customer($id = null)
{
APP::import('Model','Customer');
$this->Customer = new Customer();
$cus = $this->Customer->find('first',array('conditions'=>array('Customer.id'=>$id)));
return $cus['Customer']['customername'].'('.$cus['Customer']['tag_name'].')';
}
示例2: checktag_list
public function checktag_list($group_id=NULL)
{
APP::import('Model','Customer');
$this->Customer = new Customer();
$group_data = $this->Customer->find('all',array('conditions'=>array('Customer.customergroup_id'=>$group_id,'Customer.status'=>1)));
return count($group_data);
}
示例3: getInstance
/**
* Get singleton
* @return APP
*/
public static function getInstance()
{
if (self::$_instance == null) {
self::$_instance = new self();
}
return self::$_instance;
}
示例4: getCountFolder
/**
* count shop in folder
*
*/
public function getCountFolder($shop_id)
{
APP::import("Model", array("FolderShop"));
$this->FolderShop = new FolderShop();
$data = $this->FolderShop->find("count", array("conditions" => array("FolderShop.shop_id" => $shop_id)));
return $data;
}
示例5: dashboard_customer_name
public function dashboard_customer_name($module = NULL ,$value = NULL ,$chk_fld = NULL ,$get_fld = NULL )
{
APP::import('Model',$module);
$this->$module = new $module();
$result = $this->$module->find('first',array('conditions'=>array($module.'.'.$chk_fld=>$value)));
if(!empty($result[$module][$get_fld])) return $result[$module][$get_fld];
}
示例6: run
/**
* 框架主方法 !!!
*
* @return boolean
*/
public static function run()
{
$controller = ForceStringFrom('c');
//注意POST或GET中c和a变量名称被占用
$action = ForceStringFrom('a');
$controller = Iif($controller, $controller, self::$defaultController);
$action = Iif($action, $action, self::$defaultAction);
$app_file = "./controllers/" . $controller . ".php";
if (!is_file($app_file)) {
self::debug("file[{$app_file}] does not exists.");
return false;
} else {
require_once realpath($app_file);
}
$classname = 'c_' . $controller;
if (!class_exists($classname, false)) {
self::debug("class[{$classname}] does not exists.");
return false;
}
$path[0] = $controller;
$path[1] = $action;
self::$C = new $classname($path);
//实例化控件类, 设置为APP当前的控件对像
if (!method_exists(self::$C, $action)) {
self::debug("method[{$action}] does not exists in class[{$classname}].");
return false;
}
return call_user_func(array(&self::$C, $action), $path);
}
示例7: _getDbConnectInfo
/**
* データベースの接続先情報を取得する
*
* @access private
* @author sakuragawa
*/
private function _getDbConnectInfo()
{
$dbConfigInfo = array();
$dbConfig = new DATABASE_CONFIG();
// 読み込まれているModel分ループ
foreach ($this->controller->modelNames as $key => $val) {
APP::import('Model', $this->controller->modelNames[$key]);
$model = new $this->controller->modelNames[$key]();
$useDbConfig = $model->useDbConfig;
if (!isset($dbConfig->{$useDbConfig})) {
// 定義されてない
unset($model);
continue;
}
// 接続設定
$one = $dbConfig->{$useDbConfig};
// 必要な分のみ取り出し
$buf['driver'] = $one['driver'];
$buf['host'] = $one['host'];
$buf['database'] = $one['database'];
if (count($dbConfigInfo) != 0) {
// 初回以外
if (!in_array($buf, $dbConfigInfo)) {
$dbConfigInfo[$useDbConfig] = $buf;
}
} else {
// 初回
$dbConfigInfo[$useDbConfig] = $buf;
}
unset($model);
}
return $dbConfigInfo;
}
示例8: rankFolder
/**
* add shop to folder
*
*/
public function rankFolder($conditions, $user_id)
{
APP::import("Model", array("User"));
$this->User = new User();
$user = $this->User->findById($user_id);
$folder = $this->find('list', array('conditions' => $conditions, "group by" => "Folder.id", "order" => "FolderUser.modified DESC", 'fields' => array('FolderUser.id', 'FolderUser.id')));
$rank_folder = array();
if (!empty($folder)) {
if (empty($user["User"]["rank_folder"])) {
$rank_folder = $folder;
} else {
$list = explode(",", $user["User"]["rank_folder"]);
$listRank = array();
foreach ($list as $val) {
if (!empty($folder[$val])) {
$listRank[] = $val;
}
}
$rank_folder = array_merge($listRank, $folder);
$rank_folder = array_unique($rank_folder);
}
$user["User"]["rank_folder"] = implode(",", $rank_folder);
$this->User->save($user);
}
return $rank_folder;
}
示例9: getlog_approve_sales
public function getlog_approve_sales($salesorder_id=NULL)
{
APP::import('Model','Logactivity');
$this->Logactivity = new Logactivity();
$log_list = $this->Logactivity->find('first',array('conditions'=>array('Logactivity.logid'=>$salesorder_id)));
return $log_list['User']['username'];
}
示例10: __construct
/**
* Inicia uma sessão
* @param string $sessionName
*/
public function __construct($sessionName, $ProtectedModule = false)
{
self::start();
$this->SessionName = ($ProtectedModule ? (is_string($ProtectedModule) ? $ProtectedModule : APP::getCurrentModule()) . '-' : null) . $sessionName;
if (!isset($_SESSION[self::$_SESSION_][$this->SessionName])) {
$_SESSION[self::$_SESSION_][$this->SessionName] = null;
}
}
示例11: NewAnnex
function NewAnnex()
{
APP::import('Model', 'Annex');
$this->Annex = new Annex();
$this->Annex->create();
$this->Annex->save();
return $this->Annex->getLastInsertID();
}
示例12: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
xAC::setApiKey(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_APIKEY'));
xAC::setApiBaseUrl(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_URL'));
xAC::setApiVersion(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_APIVERSION'));
xAC::initServices(true);
return printf("Services list has been refreshed \n");
}
示例13: recipe
public function recipe()
{
$recettes = App::getInstance()->getTable('recette')->show($_GET['id']);
$categories = App::getInstance()->getTable('categorie')->show($_GET['id']);
$ingredients = App::getInstance()->getTable('ingredient')->show($_GET['id']);
$instructions = APP::getInstance()->getTable('recette')->expl($recettes);
$this->render('posts.recipe', compact('recettes', 'categories', 'ingredients', 'instructions', 'progress'));
}
示例14: __construct
public function __construct()
{
$this->_options['ci'] = $this->ci =& get_instance();
$this->theme = APP::get_namespace_id() == 'admin' ? false : true;
if (APP_DIR && is_dir(FCPATH . 'plugins/' . APP_DIR . '/') && $this->ci->controller == 'admin') {
// 表示插件的后台
$this->theme = false;
}
}
示例15: get_customer_name
public function get_customer_name($customer_id=NULL)
{
APP::import('Model','Clientpo');
$this->Customer = new Customer();
$customer = $this->Customer->find('first',array('conditions'=>array('Customer.id'=>$customer_id),'fields'=>array('Customertagname')));
if(!empty($customer)):
return $customer['Customer']['Customertagname'];
endif;
}