Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User j.bruni's Avatar
    Join Date
    Jun 2009
    Location
    Uberlândia, MG, Brazil
    Posts
    105
    Vote Rating
    7
    j.bruni is on a distinguished road

      4  

    Wink Extremely Easy Ext.Direct integration with PHP

    Extremely Easy Ext.Direct integration with PHP


    *** Compatible with ExtJS 4 ***

    This is an updated / refactored version of "Easy Ext.Direct integration with PHP"


    How to use:

    1) PHP

    PHP Code:
    <?php

    require 'ExtDirect.php';

    class 
    Server
    {
        public function 
    date$format )
        {
            return 
    date$format );
        }
    }

    ExtDirect::provide'Server' );

    ?>
    Here, "Server" is the PHP class that we want to provide access from the JavaScript code. It could be any other class.

    2) HTML:

    Code:
    <script type="text/javascript" src="ext-direct.php?javascript"></script>
    Here, "ext-direct.php" points to the PHP file shown on item 1. The "?javascript" query string is necessary, because the default output is on JSON format (good for Ext Designer).

    3) JavaScript:

    Code:
    Ext.php.Server.date( 'Y-m-d', function(result){ alert( 'Server date is ' + result ); } );
    Here, to call the "date" method from PHP "Server" class, we prepended the default namespace Ext.php. The first parameter is the $format parameter. The second parameter is the JavaScript callback function that will be executed after the AJAX call has been completed. Here, an alert box shows the result.



    What are you waiting for the download?

    It includes:

    ExtDirect.php - This is the file you include in your PHP script.
    example.php - This is a working sample (PHP part).
    example.html - The HTML and JavaScript parts of the working sample.

    In the next post, I tell you about the features and configuration options.

    Thanks.



    The current latest version is ExtDirect_2011-11-08.zip, which you can download below:
    Attached Files
    Last edited by j.bruni; 8 Nov 2011 at 5:31 PM. Reason: New version available (November 8, 2011)

  2. #2
    Sencha User khebs@live.com's Avatar
    Join Date
    Mar 2008
    Posts
    83
    Vote Rating
    0
    khebs@live.com is on a distinguished road

      0  

    Default


    You are brilliant!

  3. #3
    Sencha User j.bruni's Avatar
    Join Date
    Jun 2009
    Location
    Uberlândia, MG, Brazil
    Posts
    105
    Vote Rating
    7
    j.bruni is on a distinguished road

      0  

    Thumbs up Features

    Features


    Thanks, Khebs!

    You haven't seen nothing yet!

    Look at the Features

    - API declaration with several classes (not limited to a single class)

    - API "url", "namespace" and "descriptor" settings ("ExtDirect" class assigns them automatically if you don't)

    - Two types of API output format: "json" (for use with Ext Designer) and "javascript" (default: json)

    - You choose if the "len" attribute of the actions will count only the required parameters of the PHP method, or all of them (default: all)

    - You choose whether inherited methods will be declared in the API or not (default: no)

    - You choose whether static methods will be declared in the API or not (default: no)

    - Instantiate an object if the called method is static? You choose! (default: no)

    - Call the class constructor with the actions parameters? You choose! (default: no)

    - "debug" option to enable server exceptions to be sent in the output of API action results (default: off)

    - "utf8_encode" option to automatically apply UTF8 encoding in API action results (default: off)

    Learn how to use all these configuration options in the next post. It is so simple!

  4. #4
    Sencha User j.bruni's Avatar
    Join Date
    Jun 2009
    Location
    Uberlândia, MG, Brazil
    Posts
    105
    Vote Rating
    7
    j.bruni is on a distinguished road

      0  

    Default


    Hey! Forgot to mention in the features list:

    - Handles forms

    - Handles file uploads

  5. #5
    Sencha User j.bruni's Avatar
    Join Date
    Jun 2009
    Location
    Uberlândia, MG, Brazil
    Posts
    105
    Vote Rating
    7
    j.bruni is on a distinguished road

      0  

    Lightbulb Configuration - How To

    Configuration - How To


    Easy.

    If the configuration option name is "configuration_name" and the configuration value is $value, use this syntax:

    PHP Code:
    ExtDirect::$configuration_name $value
    And that's all.

    Now, let's see the available configuration options:

    - name: api_classes
    - type: array of strings
    - meaning: Name of the classes to be published to the Ext.Direct API
    - default: empty
    - comments: This option is overriden if you provide a non-empty $api_classes parameter for the "ExtDirect::provide" method. Choose one or another. If you want to declare a single class, you can set $api_classes as a string, instead of an array.
    - example
    PHP Code:
    ExtDirect::$api_classes = array( 'Server''OtherClass',  'StoreProvider' ); 
    - name: url
    - type: string
    - meaning: Ext.Direct API attribute "url"
    - default: $_SERVER['PHP_SELF']
    - comments: Sometimes, PHP_SELF is not what we want. So, it is possible to specify the API URL manually.
    - example
    PHP Code:
    ExtDirect::$url '/path/to/my_php_script.php'
    - name: namespace
    - type: string
    - meaning: Ext.Direct API attribute "namespace"
    - default: "Ext.php"
    - comments: Feel free to choose your own namespace, according to ExtJS rules for it.
    - example
    PHP Code:
    ExtDirect::$namespace 'Ext.Dharma'
    - name: descriptor
    - type: string
    - meaning: Ext.Direct API attribute "descriptor"
    - default: "Ext.php.REMOTING_API"
    - comments: Feel free to choose your own descriptor, according to ExtJS rules for it, and to the chosen namespace.
    - example
    PHP Code:
    ExtDirect::$descriptor 'Ext.Dharma.REMOTING_API'
    - name: count_only_required_params
    - type: boolean
    - meaning: Set this to true to count only the required parameters of a method for the API "len" attribute
    - default: false
    - example
    PHP Code:
    ExtDirect::$count_only_required_params true
    - name: include_static_methods
    - type: boolean
    - meaning: Set this to true to include static methods in the API declaration
    - default: false
    - example
    PHP Code:
    ExtDirect::$include_static_methods true
    - name: include_inherited_methods
    - type: boolean
    - meaning: Set this to true to include inherited methods in the API declaration
    - default: false
    - example
    PHP Code:
    ExtDirect::$include_inherited_methods true
    - name: instantiate_static
    - type: boolean
    - meaning: Set this to true to create an object instance of a class even if the method being called is static
    - default: false
    - example
    PHP Code:
    ExtDirect::$instantiate_static true
    - name: constructor_send_params
    - type: boolean
    - meaning: Set this to true to call the action class constructor sending the action parameters to it
    - default: false
    - example
    PHP Code:
    ExtDirect::$constructor_send_params true
    - name: debug
    - type: boolean
    - meaning: Set this to true to allow exception detailed information in the output
    - default: false
    - example
    PHP Code:
    ExtDirect::$debug true
    - name: utf8_encode
    - type: boolean
    - meaning: Set this to true to pass all action method call results through utf8_encode function
    - default: false
    - example
    PHP Code:
    ExtDirect::$utf8_encode true
    - name: default_api_output
    - type: string
    - meaning: API output format - available options are "json" (good for Ext Designer) and "javascript"
    - default: "json"
    - comments: Another way to enforce "javascript" output is to append the "?javascript" query string in the end of your PHP script URL; do this in the HTML <script> tag that refers to your API
    example
    PHP Code:
    ExtDirect::$default_api_output "javascript"

  6. #6
    Sencha User khebs@live.com's Avatar
    Join Date
    Mar 2008
    Posts
    83
    Vote Rating
    0
    khebs@live.com is on a distinguished road

      0  

    Default


    Yes i was playing with it, very good indeed.. and nice one w/ json & javascript nothing is much simpler than this.. thanks for sharing!

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Posts
    47
    Vote Rating
    0
    Andrew Peacock is on a distinguished road

      0  

    Default


    Thanks J. Saw your response in your other post, skipped over here, and like what I see. Thanks for sharing with everyone. Andy

  8. #8
    Ext User
    Join Date
    Oct 2008
    Posts
    1
    Vote Rating
    0
    ezkorpyo is on a distinguished road

      0  

    Default


    Hello, how run the example ? ? ?

    Thanks. . .

  9. #9
    Sencha User j.bruni's Avatar
    Join Date
    Jun 2009
    Location
    Uberlândia, MG, Brazil
    Posts
    105
    Vote Rating
    7
    j.bruni is on a distinguished road

      0  

    Default


    Quote Originally Posted by ezkorpyo View Post
    Hello, how run the example ? ? ?

    Thanks. . .
    1. Download the "ExtDirect.php.zip" file from post #1 of this thread.

    2. Unzip the file

    3. Copy the extracted files (ExtDirect.php, example.php, and example.html) to your web site folder (requires PHP and and HTTP, like Apache or NginX)

    4. Using your browser, go to the URL where you can access "example.html"... it can be "http://localhost/example.com" or something else, according to your settings.

    Hope this helps...

  10. #10
    Sencha User khebs@live.com's Avatar
    Join Date
    Mar 2008
    Posts
    83
    Vote Rating
    0
    khebs@live.com is on a distinguished road

      0  

    Default


    Hi i think i found a bug on your ExtDirect.php class.. when i use multiple classes i got an error at line: 381, stating that it is passing a string not an array.. so a quick fix is..

    @ExtDirect.php, line 381

    Code:
    if (!is_array($this->parameters))
                $this->parameters = array($this->parameters);
    
    return call_user_func_array( array( $this->instance, $this->method ), $this->parameters );
    Classes:

    >> Cds.php

    Code:
    <?php
    
        class Cds
        {
            public function getAll()
            {
                $db = Crystal::db();
                return $db->get('cds')->fetch_all();
            }
        }
    ?>
    >> Server.php

    Code:
    <?php
    
        class Server
        {
            public function date($timezone = 'Asia/Urumqi')
            {
                date_default_timezone_set( $timezone );
                return date( 'm/d/Y h:i:s a' );
            }
        }
        
    ?>
    >> api.php

    Code:
    <?php
        ## @required php's
        require 'libraries/ExtDirect.php';
        require 'libraries/crystal-0.4/Crystal.php';
        require 'classes/Server.php';
        require 'classes/Cds.php';
                
        ExtDirect::provide(array('Server','Cds'));
    ?>