Pages

Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts

Sunday, August 24, 2014

ZendX-Use events and properties of jquery-ui widgets in Zend forms

Recently I added a ZendX Date Picker to one of my Zend Applications now I was able to add properties but I was unable to add events so I had to use another Zend magic function
Zend_Json_Expr

As shown in code below

    /*************Order Date From****************************************/     
         $order_date_from = new ZendX_JQuery_Form_Element_DatePicker('order_date_from',  
               array('jQueryParams' => array('dateFormat' => 'yy-mm-dd',  
                 'onClose'=>new Zend_Json_Expr('function( selectedDate ) {$( "#order_date_to" ).datepicker( "option", "minDate", selectedDate );}')  
                 ))  
           );  
         $order_date_from->setAttribs(array('class'=>"",  
             //'id'=>'datepickerfrom'  
         )  
           );  
         $order_date_from->removeDecorator('DtDdWrapper')  
           ->removeDecorator('HtmlTag')  
           ->removeDecorator('Errors')  
           ->removeDecorator('Label');  
         $this->addElement($order_date_from);  
         /*************Order Date From****************************************/  
         /*************Order Date To****************************************/  
         $order_date_to = new ZendX_JQuery_Form_Element_DatePicker('order_date_to',  
               array('jQueryParams' => array(  
                 'onClose'=>new Zend_Json_Expr('function( selectedDate) {$( "#order_date_from" ).datepicker( "option", "maxDate", selectedDate );}'),  
                 'dateFormat' => 'yy-mm-dd'              
                 ))  
           );  
         $order_date_to->setAttribs(array('class'=>"",  
             //'id'=>'datepickerto'  
         )  
           );  
         $order_date_to->removeDecorator('DtDdWrapper')  
           ->removeDecorator('HtmlTag')  
           ->removeDecorator('Errors')  
           ->removeDecorator('Label');  
         $this->addElement($order_date_to);  
         /*************Order Date To****************************************/  

Thursday, November 8, 2012

WordPress $post Variable Keys

WordPress $post Variable Keys
Below are the methods of retrieving the information that you are most likely to need.
  • $post–>ID – ID of the current post.
  • $post–>post_category - Retrieves the ID of the post category.
  • $post–>post_parent - ID of the page parent. Useful for creating custom navigational elements.
  • $post–>post_title – Post Title
  • $post–>post_excerpt - Post excerpt
  • $post–>post_content – Retrieves all of the post content, along with any markup.
  • $post–>post_name – Retrieving the slug of a post.
  • $post–>guid – Post Url
  • $post–>post_author – ID of post author post_parent
  • $post–>post_type - Returns the type, page or post.
  • $post–>menu_order - Returns the menu order as set in the post/page editing window. Often menu items are sorted via this value.
  • $post–>post_date - Retrieves the integer timestamp for when the post was published. The output can be customized. See the php.net date manual.
  • $post–>post_modified - Retrieves the integer timestamp for when the post was last modified.
  • $post–>post_status - Retrieves one of five possible posts statuses: publish, private, draft, pending, future.
  • $post–>comment_count - Returns the number of comments, pings, and trackbacks for a given post.
 And here is how to use it

 <?php if (have_posts()) : while (have_posts()) : the_post();  
 //somewhere in the loop  
 $yourvariable = $post->post_content;  
 //do something  
 endwhile; endif; ?>