本文整理汇总了PHP中CMS_Asset::compile_css方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS_Asset::compile_css方法的具体用法?PHP CMS_Asset::compile_css怎么用?PHP CMS_Asset::compile_css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS_Asset
的用法示例。
在下文中一共展示了CMS_Asset::compile_css方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
?>
</title>
<?php
echo $template['metadata'];
?>
<link rel="icon" href="{{ site_favicon }}">
<!-- Le styles -->
<?php
echo $template['css'];
$asset = new CMS_Asset();
$asset->add_themes_css('bootstrap.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('style.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('css/roboto.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('css/material.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('css/ripples.min.css', '{{ used_theme }}', 'default');
echo $asset->compile_css();
?>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="{{ site_favicon }}">
<style type="text/css">{{ widget_name:section_custom_style }}</style>
</head>
<body>
<?php
echo $template['js'];
$asset->add_cms_js("bootstrap/js/bootstrap.min.js");
$asset->add_themes_js('js/ripples.min.js', '{{ used_theme }}', 'default');
$asset->add_themes_js('js/material.min.js', '{{ used_theme }}', 'default');
$asset->add_themes_js('script.js', '{{ used_theme }}', 'default');
echo $asset->compile_js();
?>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
示例2: index
//.........这里部分代码省略.........
// $crud->unset_add();
// $crud->unset_edit();
// $crud->unset_list();
// $crud->unset_back_to_list();
// $crud->unset_print();
// $crud->unset_export();
// set model
// $crud->set_model($this->cms_module_path().'/grocerycrud_main_language_model');
// adjust groceryCRUD's language to No-CMS's language
$crud->set_language($this->cms_language());
// table name
$crud->set_table(cms_table_name('main_language'));
// set subject
$crud->set_subject('Language');
// displayed columns on list
$crud->columns('name', 'code', 'iso_code', 'translations');
// displayed columns on edit operation
$crud->edit_fields('name', 'code', 'iso_code', 'translations');
// displayed columns on add operation
$crud->add_fields('name', 'code', 'iso_code', 'translations');
// caption of each columns
$crud->display_as('name', 'Name');
$crud->display_as('iso_code', 'ISO Code');
$crud->display_as('translations', 'Translations');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put required field validation codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/required_fields)
// eg:
// $crud->required_fields( $field1, $field2, $field3, ... );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud->required_fields('name', 'code');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put required field validation codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/unique_fields)
// eg:
// $crud->unique_fields( $field1, $field2, $field3, ... );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud->unique_fields('name', 'code', 'iso_code');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put field validation codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/set_rules)
// eg:
// $crud->set_rules( $field_name , $caption, $filter );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put set relation (lookup) codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation)
// eg:
// $crud->set_relation( $field_name , $related_table, $related_title_field , $where , $order_by );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put set relation_n_n (detail many to many) codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n)
// eg:
// $crud->set_relation_n_n( $field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table,
// $primary_key_alias_to_selection_table , $title_field_selection_table, $priority_field_relation );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put custom field type here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/field_type)
// eg:
// $crud->field_type( $field_name , $field_type, $value );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put callback here
// (documentation: httm://www.grocerycrud.com/documentation/options_functions)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud->callback_before_insert(array($this, '_before_insert'));
$crud->callback_before_update(array($this, '_before_update'));
$crud->callback_before_delete(array($this, '_before_delete'));
$crud->callback_after_insert(array($this, '_after_insert'));
$crud->callback_after_update(array($this, '_after_update'));
$crud->callback_after_delete(array($this, '_after_delete'));
$crud->callback_column('translations', array($this, '_callback_column_translations'));
$crud->callback_field('translations', array($this, '_callback_field_translations'));
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put custom error message here
// (documentation: httm://www.grocerycrud.com/documentation/set_lang_string)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// $crud->set_lang_string('delete_error_message', 'Cannot delete the record');
// $crud->set_lang_string('update_error', 'Cannot edit the record' );
// $crud->set_lang_string('insert_error', 'Cannot add the record' );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// render
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$output = $crud->render();
// prepare css & js, add them to config
$config = array();
$asset = new CMS_Asset();
foreach ($output->css_files as $file) {
$asset->add_css($file);
}
$config['css'] = $asset->compile_css();
foreach ($output->js_files as $file) {
$asset->add_js($file);
}
$config['js'] = $asset->compile_js();
// show the view
$this->view($this->cms_module_path() . '/language/manage_main_language_view', $output, $this->cms_complete_navigation_name('main_language_management'), $config);
}
示例3: index
public function index()
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// initialize groceryCRUD
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud = $this->new_crud();
$crud->unset_jquery();
$crud->unset_print();
$crud->unset_export();
// set model
// $crud->set_model($this->cms_module_path().'/grocerycrud_category_model');
// adjust groceryCRUD's language to No-CMS's language
$crud->set_language($this->cms_language());
// table name
$crud->set_table($this->cms_complete_table_name('category'));
// set subject
$crud->set_subject('Category');
// displayed columns on list
$crud->columns('category_name', 'description', 'articles');
// displayed columns on edit operation
$crud->edit_fields('category_name', 'description', 'articles');
// displayed columns on add operation
$crud->add_fields('category_name', 'description', 'articles');
// required field
$crud->required_fields('category_name');
$crud->unique_fields('category_name');
$crud->unset_read();
// caption of each columns
$crud->display_as('category_name', 'Category Name');
$crud->display_as('description', 'Description');
$crud->display_as('articles', 'Articles');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put set relation (lookup) codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation)
// eg:
// $crud->set_relation( $field_name , $related_table, $related_title_field , $where , $order_by );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put set relation_n_n (detail many to many) codes here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n)
// eg:
// $crud->set_relation_n_n( $field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table,
// $primary_key_alias_to_selection_table , $title_field_selection_table, $priority_field_relation );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud->set_relation_n_n('articles', $this->cms_complete_table_name('category_article'), $this->cms_complete_table_name('article'), 'category_id', 'article_id', 'article_title', NULL);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put custom field type here
// (documentation: http://www.grocerycrud.com/documentation/options_functions/field_type)
// eg:
// $crud->field_type( $field_name , $field_type, $value );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud->unset_texteditor('description');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HINT: Put callback here
// (documentation: httm://www.grocerycrud.com/documentation/options_functions)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud->callback_before_insert(array($this, 'before_insert'));
$crud->callback_before_update(array($this, 'before_update'));
$crud->callback_before_delete(array($this, 'before_delete'));
$crud->callback_after_insert(array($this, 'after_insert'));
$crud->callback_after_update(array($this, 'after_update'));
$crud->callback_after_delete(array($this, 'after_delete'));
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// render
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$output = $crud->render();
// prepare css & js, add them to config
$config = array();
$asset = new CMS_Asset();
foreach ($output->css_files as $file) {
$asset->add_css($file);
}
$config['css'] = $asset->compile_css();
foreach ($output->js_files as $file) {
$asset->add_js($file);
}
$config['js'] = $asset->compile_js();
// show the view
$this->view($this->cms_module_path() . '/manage_category_view', $output, $this->cms_complete_navigation_name('manage_category'), $config);
}
示例4: config
public function config()
{
$this->cms_guard_page('main_config_management');
$crud = $this->new_crud();
$crud->unset_jquery();
$crud->set_table(cms_table_name('main_config'));
$crud->set_subject($this->cms_lang('Configuration'));
$crud->unique_fields('config_name');
$crud->unset_read();
$crud->unset_delete();
$crud->columns('config_name', 'value');
$crud->edit_fields('config_name', 'value', 'description');
$crud->add_fields('config_name', 'value', 'description');
$crud->display_as('config_name', 'Configuration Key')->display_as('value', 'Configuration Value')->display_as('description', 'Description');
$crud->unset_texteditor('description');
$crud->unset_texteditor('value');
$operation = $crud->getState();
if ($operation == 'edit' || $operation == 'update' || $operation == 'update_validation') {
$crud->field_type('config_name', 'readonly');
$crud->field_type('description', 'readonly');
} else {
if ($operation == 'add' || $operation == 'insert' || $operation == 'insert_validation') {
//$crud->set_rules('config_name', 'Configuration Key', 'required');
$crud->required_fields('config_name');
}
}
$crud->callback_after_insert(array($this, 'after_insert_config'));
$crud->callback_after_update(array($this, 'after_update_config'));
$crud->callback_before_delete(array($this, 'before_delete_config'));
$crud->set_language($this->cms_language());
$output = $crud->render();
// prepare css & js, add them to config
$config = array();
$asset = new CMS_Asset();
foreach ($output->css_files as $file) {
$asset->add_css($file);
}
$config['css'] = $asset->compile_css();
foreach ($output->js_files as $file) {
$asset->add_js($file);
}
$config['js'] = $asset->compile_js();
// show the view
$this->view('main/main_config', $output, 'main_config_management', $config);
}
示例5: video
public function video()
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// initialize groceryCRUD
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$crud = $this->new_crud();
$crud->unset_edit();
$crud->unset_jquery();
$crud->unset_print();
$crud->unset_export();
// adjust groceryCRUD's language to No-CMS's language
$crud->set_language($this->cms_language());
// table name
$crud->set_table($this->cms_complete_table_name('video'));
// set subject
$crud->set_subject('Video');
// displayed columns on list
$crud->columns('nama', 'link');
// displayed columns on add operation
$crud->add_fields('nama');
$crud->required_fields('nama');
$crud->unset_read();
// caption of each columns
$crud->display_as('nama', 'File Video');
$crud->callback_after_delete(array($this, 'after_delete'));
$crud->callback_column('nama', array($this, 'callback_column_nama'));
$crud->callback_column('link', array($this, 'callback_column_link'));
$crud->set_field_upload('nama', 'modules/blog/assets/uploads/video');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// render
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$output = $crud->render();
// prepare css & js, add them to config
$config = array();
$asset = new CMS_Asset();
foreach ($output->css_files as $file) {
$asset->add_css($file);
}
$config['css'] = $asset->compile_css();
foreach ($output->js_files as $file) {
$asset->add_js($file);
}
$config['js'] = $asset->compile_js();
// show the view
$this->view($this->cms_module_path() . '/manage_video_view', $output, $this->cms_complete_navigation_name('manage_video'), $config);
}