Normally php code is commented out like this in the Page-Editor
<!--?php your phpCode; ?-->
This is done by the CKEditor to protect code.
I tested following solution:
Opened file "...\admin\template\ckeditor\js\config.js and
added following code at the end:
QUOTE
// Test insert php code
CKEDITOR.editorConfig = function(config) {
config.protectedSource.push(/<\?[\s\S]*?\?>/g); // PHP Code
config.protectedSource.push(/<code>[\s\S]*?<\/code>/gi); // Code tags
}
UNQUOTE
Then I put following code into a test page directly (using "Source Code")
<?php echo "Hello World"; ?> (this is not visible in the normal input)
In the "prewiew" the Text Hello World was written (and it was not commented out...)
Somebody here said: php code or a database connection is not neccessary. I agree, but in some cases it is
an advantage, using a database for storing and editing data.
I also use the script injector plug-in from time to time for that purpose, works fine.
Any comments appreciated...
<!--?php your phpCode; ?-->
This is done by the CKEditor to protect code.
I tested following solution:
Opened file "...\admin\template\ckeditor\js\config.js and
added following code at the end:
QUOTE
// Test insert php code
CKEDITOR.editorConfig = function(config) {
config.protectedSource.push(/<\?[\s\S]*?\?>/g); // PHP Code
config.protectedSource.push(/<code>[\s\S]*?<\/code>/gi); // Code tags
}
UNQUOTE
Then I put following code into a test page directly (using "Source Code")
<?php echo "Hello World"; ?> (this is not visible in the normal input)
In the "prewiew" the Text Hello World was written (and it was not commented out...)
Somebody here said: php code or a database connection is not neccessary. I agree, but in some cases it is
an advantage, using a database for storing and editing data.
I also use the script injector plug-in from time to time for that purpose, works fine.
Any comments appreciated...
Thats all "volks"
PauliOpa
werrechtschreibfehlerfindetdarfsiebehalten
PauliOpa
werrechtschreibfehlerfindetdarfsiebehalten