This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ページタイプの「出力」で'Main'エリアにコンポーザーで扱うcontentブロックを入れてる場合 | |
$pageType = \PageType::getByHandle('ページタイプハンドル'); | |
$template = $pageType->getPageTypeDefaultPageTemplateObject(); | |
$d = $pageType->createDraft($template); | |
$d->setPageDraftTargetParentPageID(親ページID); | |
$pageType->savePageTypeComposerForm($d); | |
$pageType->publish($d); | |
//$dには追加したページオブジェクトが入ってくる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model:: | |
/*Select*/ | |
select('col1','col2') | |
->select(array('col1','col2')) | |
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating')) | |
->addSelect('col3','col4') | |
->distinct() // distinct select | |
/*From*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Concrete\Package\JapaneseCommunity; | |
use Config; | |
defined('C5_EXECUTE') or die('Access Denied.'); | |
class Controller extends \Concrete\Core\Package\Package { | |
protected $pkgHandle = 'japanese_community'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$form = Loader::helper('form'); | |
Loader::element('editor_config'); | |
Loader::element('editor_controls'); | |
echo $form->textarea("textareaID", $details, array('class'=>"ccm-advanced-editor")); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------- | |
# homepage URL | |
# ------------------- | |
<?php echo DIR_REL; ?> | |
# ------------------- | |
# Theme path | |
# ------------------- | |
<?php echo $this->getThemePath(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
// open a docblock with enter | |
{ "keys": ["enter"], "command": "jsdocs", | |
"context": [ | |
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, | |
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\/\\*|###)\\*$", "match_all": true } | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_search($search, $wp_query) { | |
global $wpdb; | |
//サーチページ以外だったら終了 | |
if (!$wp_query->is_search) | |
return $search; | |
if (!isset($wp_query->query_vars)) | |
return $search; |