PHP in Plugins

April 3rd, 2009 by HTML-Kit Support      Tags: HTML-Kit Tools       Views: 10095
VN:F [1.7.3_972]
Rating: 5.0/5 (2 votes cast)
 

If you code in PHP, even if you’re a newcomer to PHP, HTML-Kit Tools makes it easier to use that knowledge to improve the way you use HTML-Kit.

Getting Started

First things first… make sure that PHP is installed on your local system. PHP 5+ is recommended, which you can download from www.php.net. For details on how to install PHP, refer to How to install PHP.

Also make sure that you’re using HTML-Kit Tools 20090406+.

First plugin in PHP

Here are the quick steps:

  1. Select "File > Insert > Add New Snippet" from HTML-Kit Tools main menu.
  2. Enter "My first PHP plugin" (or other title) in the "Title" field, and select "PHP" for the "Plugin Language."
  3. Type the following PHP code in to the "Snippet" field and click "OK" to close the snippet dialog.
     

    <?php
    echo "Hello, world! It's " . date('h:i A');
    ?>

To test your new snippet plugin, create a new document and select "File > Insert > My first PHP plugin" from the main menu.

Caret Action in PHP

Here’s how to manipulate selected text with a PHP plugin:

  1. Right click inside a document and select "Extra > Edit Caret Actions."
  2. Click "New" to create a new Caret Action.
  3. In "Short name" field enter "phpcaretaction1″ (without quotes). Enter "My First PHP Caret Action" in "Title" field. Click "OK" to create the new Caret Action.
  4. Paste the following code inside newly created action:
     

    #@begin-text "default" [plang="php"]
    <?php echo strtoupper( $HKit->GetSelText() ); ?>
    #@end-text "default"
  5. Click "OK" to save changes.

To test the Caret Action, select some text in the current document and right click while pressing Ctrl key down. Select "My First PHP Caret Action" from the menu.

Was this article helpful?
This did not answer my questionThis answered my question (+4 rating, 6 votes)
Loading ... Loading ...
Share this on:
  • Twitter
  • Digg
  • StumbleUpon
  • Facebook
  • MySpace
  • del.icio.us
  • Sphinn
  • LinkedIn
  • Google Bookmarks
  • Live
  • Yahoo! Buzz
  • email
  • Print
 

8 Responses to “PHP in Plugins”

  1. Frederick says:

    monroe@repeat.labels” rel=”nofollow”>.…

    hello….

  2. Larry says:

    writer@emerge.pseudynom” rel=”nofollow”>.…

    спс за инфу!…

  3. Eric says:

    stein@kraemer.deterrence” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  4. Benjamin says:

    intramuscularly@crouchin.applauded” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  5. bill says:

    titre@pittsburgh.prefaced” rel=”nofollow”>.…

    hello….

  6. Austin says:

    jokes@sucking.unmolested” rel=”nofollow”>.…

    ñïñ!…

  7. Charlie says:

    chase@diversification.walbridge” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  8. Dustin says:

    sluggishly@gulfs.ducts” rel=”nofollow”>.…

    ñïàñèáî….

Do you have a question that requires a reply? Please post it here for a timely and friendly reply.
 
If you have a comment, you can post it below. Not all comments are read, so be sure to use the support forum instead if you need an answer.
 
Leave a Comment or use the support forum if you have a question.

 

© 2009 HTML-Kit.com. All Rights Reserved.  |  Privacy Statement   
HTML design aid